mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 05:58:53 -04:00
Also store consent to research against a service
It makes most sense to collect this at the same time as the estimated volumes. Which means we need to store it somewhere; we can’t put it straight into the ticket.
This commit is contained in:
@@ -644,6 +644,30 @@ def test_update_service_sets_volumes(
|
||||
assert getattr(sample_service, field) == expected_persisted
|
||||
|
||||
|
||||
@pytest.mark.parametrize('value, expected_status, expected_persisted', (
|
||||
(True, 200, True),
|
||||
(False, 200, False),
|
||||
('Yes', 400, False),
|
||||
))
|
||||
def test_update_service_sets_research_consent(
|
||||
admin_request,
|
||||
sample_service,
|
||||
value,
|
||||
expected_status,
|
||||
expected_persisted,
|
||||
):
|
||||
assert sample_service.consent_to_research is False
|
||||
admin_request.post(
|
||||
'service.update_service',
|
||||
service_id=sample_service.id,
|
||||
_data={
|
||||
'consent_to_research': value,
|
||||
},
|
||||
_expected_status=expected_status,
|
||||
)
|
||||
assert sample_service.consent_to_research is expected_persisted
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def service_with_no_permissions(notify_db, notify_db_session):
|
||||
return create_service(service_permissions=[])
|
||||
|
||||
Reference in New Issue
Block a user