mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-24 18:09:13 -04:00
Make created_at a property of contact lists
The view layer shouldn’t be having to deal with converting dates as strings. This is an artefact of how we send data from the API to the admin app. The model layer should be responsible for turning JSON into richer types, where it can.
This commit is contained in:
9
tests/app/models/test_contact_list.py
Normal file
9
tests/app/models/test_contact_list.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from datetime import datetime
|
||||
|
||||
from app.models.contact_list import ContactList
|
||||
|
||||
|
||||
def test_created_at():
|
||||
created_at = ContactList({'created_at': '2016-05-06T07:08:09.061258'}).created_at
|
||||
assert isinstance(created_at, datetime)
|
||||
assert created_at.isoformat() == '2016-05-06T08:08:09.061258+01:00'
|
||||
Reference in New Issue
Block a user