Skip to content

Commit be7c673

Browse files
Add cost to message list
1 parent c721594 commit be7c673

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/schemas/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def parsed_details(self):
7171
'update_ts': self.update_ts,
7272
'status': self.get_status_display(),
7373
'method': self.method,
74+
'cost': self.cost,
7475
}
7576

7677
def get_attachments(self):

tests/test_user_display.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def test_user_list(cli, settings, send_email, sync_db: SyncDb):
5151
'status': 'Sent',
5252
'method': 'email-test',
5353
'subject': 'test message',
54+
'cost': 0,
5455
}
5556

5657

@@ -79,6 +80,7 @@ def test_user_list_no_ext(cli, settings, send_email, sync_db: SyncDb):
7980
'status': 'Sent',
8081
'method': 'email-test',
8182
'subject': 'test message',
83+
'cost': 0,
8284
}
8385

8486

@@ -293,6 +295,7 @@ def test_message_details(cli, settings, send_email, sync_db: SyncDb, worker, loo
293295
'body': '<body>\nthis is a test\n</body>',
294296
'events': [{'status': 'Opened', 'datetime': RegexStr(r'\d{4}-\d{2}-\d{2}.*')}],
295297
'attachments': [],
298+
'cost': 0,
296299
}
297300

298301

@@ -336,6 +339,7 @@ def test_message_details_links(cli, settings, send_email, sync_db: SyncDb, worke
336339
'method': 'email-test',
337340
'events': [{'status': 'Opened', 'datetime': RegexStr(r'\d{4}-\d{2}-\d{2}.*')}],
338341
'attachments': [['/attachment-doc/123/', 'testing.pdf'], ['#', 'different.pdf']],
342+
'cost': 0,
339343
}
340344

341345

@@ -422,6 +426,7 @@ def test_user_sms_list(cli, settings, send_sms, sync_db: SyncDb):
422426
'update_ts': RegexStr(r'\d{4}-\d{2}-\d{2}.*'),
423427
'status': 'Sent',
424428
'method': 'sms-test',
429+
'cost': 0.012,
425430
},
426431
],
427432
'count': 1,

0 commit comments

Comments
 (0)