Add columns for on whose behalf agreement signed

This is changing because we’re going to introduce accepting contracts
and MoUs online.

Previously
---
We had one column for who signed the agreement, which is foreign keyed
to the user table. This is still relevant, because there will always be
a user who is clicking the button.

Now
---
We add two new fields for the name and email address of the person on
whose behalf the agreement is being accepted. This person:
- is different from the one signing the agreement
- won’t necessarily have a Notify account
This commit is contained in:
Chris Hill-Scott
2019-06-13 16:43:34 +01:00
parent 3cde623ce2
commit 8977f5193e
3 changed files with 34 additions and 0 deletions

View File

@@ -51,6 +51,8 @@ def test_get_organisation_by_id(admin_request, notify_db_session):
'agreement_signed_at',
'agreement_signed_by_id',
'agreement_signed_version',
'agreement_signed_on_behalf_of_name',
'agreement_signed_on_behalf_of_email_address',
'letter_branding_id',
'email_branding_id',
'domains',
@@ -70,6 +72,8 @@ def test_get_organisation_by_id(admin_request, notify_db_session):
assert response['domains'] == []
assert response['request_to_go_live_notes'] is None
assert response['count_of_live_services'] == 0
assert response['agreement_signed_on_behalf_of_name'] is None
assert response['agreement_signed_on_behalf_of_email_address'] is None
def test_get_organisation_by_id_returns_domains(admin_request, notify_db_session):
@@ -197,6 +201,8 @@ def test_post_update_organisation_updates_fields(
'active': False,
'agreement_signed': agreement_signed,
'crown': crown,
'agreement_signed_on_behalf_of_name': 'Firstname Lastname',
'agreement_signed_on_behalf_of_email_address': 'test@example.com',
}
assert org.agreement_signed is None
assert org.crown is None
@@ -217,6 +223,8 @@ def test_post_update_organisation_updates_fields(
assert organisation[0].agreement_signed == agreement_signed
assert organisation[0].crown == crown
assert organisation[0].domains == []
assert organisation[0].agreement_signed_on_behalf_of_name == 'Firstname Lastname'
assert organisation[0].agreement_signed_on_behalf_of_email_address == 'test@example.com'
@pytest.mark.parametrize('domain_list', (