mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
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:
@@ -4,9 +4,12 @@ post_create_email_branding_schema = {
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"colour": {"type": ["string", "null"]},
|
"colour": {"type": ["string", "null"]},
|
||||||
|
"banner_colour": {"type": ["string", "null"]},
|
||||||
|
"single_id_colour": {"type": ["string", "null"]},
|
||||||
"name": {"type": ["string", "null"]},
|
"name": {"type": ["string", "null"]},
|
||||||
"text": {"type": ["string", "null"]},
|
"text": {"type": ["string", "null"]},
|
||||||
"logo": {"type": ["string", "null"]}
|
"logo": {"type": ["string", "null"]},
|
||||||
|
"domain": {"type": ["string", "null"]},
|
||||||
},
|
},
|
||||||
"required": []
|
"required": []
|
||||||
}
|
}
|
||||||
@@ -17,9 +20,12 @@ post_update_email_branding_schema = {
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"colour": {"type": ["string", "null"]},
|
"colour": {"type": ["string", "null"]},
|
||||||
|
"banner_colour": {"type": ["string", "null"]},
|
||||||
|
"single_id_colour": {"type": ["string", "null"]},
|
||||||
"name": {"type": ["string", "null"]},
|
"name": {"type": ["string", "null"]},
|
||||||
"text": {"type": ["string", "null"]},
|
"text": {"type": ["string", "null"]},
|
||||||
"logo": {"type": ["string", "null"]}
|
"logo": {"type": ["string", "null"]},
|
||||||
|
"domain": {"type": ["string", "null"]},
|
||||||
},
|
},
|
||||||
"required": []
|
"required": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ def test_post_create_email_branding(admin_request, notify_db_session):
|
|||||||
data = {
|
data = {
|
||||||
'name': 'test email_branding',
|
'name': 'test email_branding',
|
||||||
'colour': '#0000ff',
|
'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(
|
response = admin_request.post(
|
||||||
'email_branding.create_email_branding',
|
'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['name'] == response['data']['name']
|
||||||
assert data['colour'] == response['data']['colour']
|
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['logo'] == response['data']['logo']
|
||||||
assert data['name'] == response['data']['text']
|
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):
|
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', [
|
@pytest.mark.parametrize('data_update', [
|
||||||
({'name': 'test email_branding 1'}),
|
({'name': 'test email_branding 1'}),
|
||||||
({'logo': 'images/text_x3.png', 'colour': '#ffffff'}),
|
({'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):
|
def test_post_update_email_branding_updates_field(admin_request, notify_db_session, data_update):
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user