Skip to content

Commit

Permalink
episode-fields-to-extract
Browse files Browse the repository at this point in the history
  • Loading branch information
fredkingham committed Apr 5, 2017
1 parent b07ab28 commit d379f53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion opal/core/search/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def episode_csv(episodes, user, file_name):
"""
logging.info("writing eposides")
with open(file_name, "w") as csv_file:
fieldnames = Episode._get_fieldnames_to_serialize()
fieldnames = Episode._get_fieldnames_to_extract()
fieldnames.remove('consistency_token')
headers = list(fieldnames)
headers.append("tagging")
Expand Down
7 changes: 7 additions & 0 deletions opal/tests/test_episode.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ def test_to_dict_fields(self):

self.assertEqual(as_dict["stage"], "Active TB")

def test_get_field_names_to_extract(self):
# field names to extract should be the same
# as the field names to serialise
self.assertEqual(
Episode._get_fieldnames_to_serialize(),
Episode._get_fieldnames_to_extract()
)

@patch('opal.models.episode_subrecords')
def test_not_bulk_serialisable_episode_subrecords(self, episode_subrecords):
Expand Down

0 comments on commit d379f53

Please sign in to comment.