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:
Chris Hill-Scott
2019-02-14 23:57:08 +00:00
parent ecdf076506
commit f679731af8
3 changed files with 35 additions and 8 deletions

View File

@@ -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=[])