Skip to content

Commit 089930b

Browse files
committed
Put a dot between the collection and the acct num
Visually (and prob programatically) easier to parse
1 parent 04618e9 commit 089930b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

django/parse_m2/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def parse_from_segment(cls, base_seg: str, m2_data_file: M2DataFile, activity_da
169169
# If 'collection' is provided, prepend to account number
170170
account_num = get_field_value(fields.base_fields, "cons_acct_num", base_seg)
171171
if m2_data_file.collection:
172-
account_num = f"{m2_data_file.collection}{account_num}"
172+
account_num = f"{m2_data_file.collection}.{account_num}"
173173

174174
return cls(
175175
data_file = m2_data_file,

django/parse_m2/tests/test_initiate_parsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_open_zipfiles(self):
5454
self.assertEqual(AccountActivity.objects.count(), 1997)
5555

5656
def test_prepend_collection_onto_account_num(self):
57-
parse_files_from_local_filesystem(self.event, collection="HEALTH.")
57+
parse_files_from_local_filesystem(self.event, collection="HEALTH")
5858

5959
# one M2DataFile object for each file
6060
self.assertEqual(M2DataFile.objects.count(), 3)

django/parse_m2/tests/test_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def test_parser_saves_header_as_unparseable(self):
265265
# Tests for prepending a collection name to the account number
266266
def test_collection_prefix_on_account_number(self):
267267
event = Metro2Event.objects.create(name='exam_with_collections')
268-
parser = M2FileParser(event=event, filepath="file.txt", collection="HEALTH.")
268+
parser = M2FileParser(event=event, filepath="file.txt", collection="HEALTH")
269269

270270
file_size = os.path.getsize(self.tiny_file)
271271
with open(self.tiny_file, mode='r') as filestream:

0 commit comments

Comments
 (0)