mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
move deactivate functionality into one database transactions
this means that any errors will cause the entire thing to roll back unfortunately, to do this we have to circumvent our regular code, which calls commit a lot, and lazily loads a lot of things, which will flush, and cause the version decorators to fail. so we have to write a lot of stuff by hand and re-select the service (even though it's already been queried) just to populate the api_keys and templates relationship on it
This commit is contained in:
@@ -57,7 +57,7 @@ def test_deactivating_service_revokes_api_keys(deactivated_service):
|
||||
|
||||
|
||||
def test_deactivating_service_archives_templates(deactivated_service):
|
||||
assert deactivated_service.templates.count() == 2
|
||||
assert len(deactivated_service.templates) == 2
|
||||
for template in deactivated_service.templates:
|
||||
assert template.archived is True
|
||||
assert template.version == 2
|
||||
|
||||
Reference in New Issue
Block a user