add updated_at to provider_details

it's set to utcnow from dao_update_provider_details
This commit is contained in:
Leo Hemsted
2016-12-19 17:45:46 +00:00
parent b39a027aeb
commit f1899c6d53
6 changed files with 31 additions and 5 deletions

View File

@@ -43,7 +43,9 @@ def test_get_provider_details_contains_correct_fields(client, notify_db):
headers=[create_authorization_header()]
)
json_resp = json.loads(response.get_data(as_text=True))['provider_details']
allowed_keys = {"id", "display_name", "identifier", "priority", 'notification_type', "active", "version"}
allowed_keys = {
"id", "display_name", "identifier", "priority", 'notification_type', "active", "version", "updated_at"
}
assert allowed_keys == set(json_resp[0].keys())
@@ -81,7 +83,11 @@ def test_should_be_able_to_update_status(client, restore_provider_details):
assert not provider.active
@pytest.mark.parametrize('field,value', [('identifier', 'new'), ('version', 7)])
@pytest.mark.parametrize('field,value', [
('identifier', 'new'),
('version', 7),
('updated_at', None)
])
def test_should_not_be_able_to_update_disallowed_fields(client, restore_provider_details, field, value):
provider = ProviderDetails.query.first()