Skip to content

Commit

Permalink
Merge 2146311 into bcf4a24
Browse files Browse the repository at this point in the history
  • Loading branch information
josenavas committed Jun 19, 2014
2 parents bcf4a24 + 2146311 commit ef8f83a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions qiita_db/metadata_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ def create(cls, md_template, obj):
# We are going to modify the md_template. We create a copy so
# we don't modify the user one
md_template = deepcopy(md_template)
# In the database, all the column headers are lowercase
md_template.columns = [c.lower() for c in md_template.columns]

conn_handler = SQLConnectionHandler()
# Check that md_template have the required columns
Expand Down
14 changes: 7 additions & 7 deletions qiita_db/test/test_metadata_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def setUp(self):
'collection_timestamp':
datetime(2014, 5, 29, 12, 24, 51),
'host_subject_id': 'NotIdentified',
'description': 'Test Sample 1',
'Description': 'Test Sample 1',
'str_column': 'Value for sample 1'},
'Sample2': {'physical_location': 'location1',
'has_physical_specimen': True,
Expand All @@ -491,7 +491,7 @@ def setUp(self):
'collection_timestamp':
datetime(2014, 5, 29, 12, 24, 51),
'host_subject_id': 'NotIdentified',
'description': 'Test Sample 2',
'Description': 'Test Sample 2',
'str_column': 'Value for sample 2'},
'Sample3': {'physical_location': 'location1',
'has_physical_specimen': True,
Expand All @@ -501,7 +501,7 @@ def setUp(self):
'collection_timestamp':
datetime(2014, 5, 29, 12, 24, 51),
'host_subject_id': 'NotIdentified',
'description': 'Test Sample 3',
'Description': 'Test Sample 3',
'str_column': 'Value for sample 3'}
}
self.metadata = pd.DataFrame.from_dict(metadata_dict, orient='index')
Expand Down Expand Up @@ -556,7 +556,7 @@ def test_create_duplicate(self):
with self.assertRaises(QiitaDBDuplicateError):
SampleTemplate.create(self.metadata, self.test_study)

def test_create_(self):
def test_create(self):
"""Creates a new SampleTemplate"""
st = SampleTemplate.create(self.metadata, self.new_study)
# The returned object has the correct id
Expand Down Expand Up @@ -750,21 +750,21 @@ def setUp(self):
'center_project_name': 'Test Project',
'ebi_submission_accession': None,
'ebi_study_accession': None,
'emp_status_id': 1,
'EMP_status_id': 1,
'data_type_id': 2,
'str_column': 'Value for sample 1'},
'SKD8.640184': {'center_name': 'ANL',
'center_project_name': 'Test Project',
'ebi_submission_accession': None,
'ebi_study_accession': None,
'emp_status_id': 1,
'EMP_status_id': 1,
'data_type_id': 2,
'str_column': 'Value for sample 2'},
'SKB7.640196': {'center_name': 'ANL',
'center_project_name': 'Test Project',
'ebi_submission_accession': None,
'ebi_study_accession': None,
'emp_status_id': 1,
'EMP_status_id': 1,
'data_type_id': 2,
'str_column': 'Value for sample 3'}
}
Expand Down

0 comments on commit ef8f83a

Please sign in to comment.