Add banner_colour, single_id_colour, and domain to email_branding_schema.

The Admin app can now be updated to send the new columns to update/create email_branding
This commit is contained in:
Rebecca Law
2018-08-20 10:57:42 +01:00
parent 1658f4de71
commit 0b0e551626
2 changed files with 17 additions and 3 deletions

View File

@@ -4,9 +4,12 @@ post_create_email_branding_schema = {
"type": "object",
"properties": {
"colour": {"type": ["string", "null"]},
"banner_colour": {"type": ["string", "null"]},
"single_id_colour": {"type": ["string", "null"]},
"name": {"type": ["string", "null"]},
"text": {"type": ["string", "null"]},
"logo": {"type": ["string", "null"]}
"logo": {"type": ["string", "null"]},
"domain": {"type": ["string", "null"]},
},
"required": []
}
@@ -17,9 +20,12 @@ post_update_email_branding_schema = {
"type": "object",
"properties": {
"colour": {"type": ["string", "null"]},
"banner_colour": {"type": ["string", "null"]},
"single_id_colour": {"type": ["string", "null"]},
"name": {"type": ["string", "null"]},
"text": {"type": ["string", "null"]},
"logo": {"type": ["string", "null"]}
"logo": {"type": ["string", "null"]},
"domain": {"type": ["string", "null"]},
},
"required": []
}

View File

@@ -45,7 +45,10 @@ def test_post_create_email_branding(admin_request, notify_db_session):
data = {
'name': 'test email_branding',
'colour': '#0000ff',
'logo': '/images/test_x2.png'
'banner_colour': '#808080',
'single_id_colour': '#FF0000',
'logo': '/images/test_x2.png',
'domain': 'gov.uk'
}
response = admin_request.post(
'email_branding.create_email_branding',
@@ -54,8 +57,11 @@ def test_post_create_email_branding(admin_request, notify_db_session):
)
assert data['name'] == response['data']['name']
assert data['colour'] == response['data']['colour']
assert data['banner_colour'] == response['data']['banner_colour']
assert data['single_id_colour'] == response['data']['single_id_colour']
assert data['logo'] == response['data']['logo']
assert data['name'] == response['data']['text']
assert data['domain'] == response['data']['domain']
def test_post_create_email_branding_without_logo_is_ok(admin_request, notify_db_session):
@@ -142,6 +148,8 @@ def test_post_create_email_branding_with_text_as_none_and_name(admin_request, no
@pytest.mark.parametrize('data_update', [
({'name': 'test email_branding 1'}),
({'logo': 'images/text_x3.png', 'colour': '#ffffff'}),
({'logo': 'images/text_x3.png', 'banner_colour': '#ffffff', 'single_id_colour': '#808080'}),
({'logo': 'images/text_x3.png', 'banner_colour': '#ffffff', 'single_id_colour': '#808080', 'domain': 'gov.uk'}),
])
def test_post_update_email_branding_updates_field(admin_request, notify_db_session, data_update):
data = {