mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Add test for updating default branding
This commit is contained in:
@@ -4,7 +4,14 @@ import pytest
|
||||
|
||||
from app.models import Organisation
|
||||
from app.dao.organisation_dao import dao_add_service_to_organisation, dao_add_user_to_organisation
|
||||
from tests.app.db import create_domain, create_organisation, create_service, create_user
|
||||
from tests.app.db import (
|
||||
create_domain,
|
||||
create_email_branding,
|
||||
create_letter_branding,
|
||||
create_organisation,
|
||||
create_service,
|
||||
create_user,
|
||||
)
|
||||
|
||||
|
||||
def test_get_all_organisations(admin_request, notify_db_session):
|
||||
@@ -224,6 +231,33 @@ def test_update_other_organisation_attributes_doesnt_clear_domains(
|
||||
]
|
||||
|
||||
|
||||
def test_update_organisation_default_branding(
|
||||
admin_request,
|
||||
notify_db_session,
|
||||
):
|
||||
|
||||
org = create_organisation(name='Test Organisation')
|
||||
|
||||
email_branding = create_email_branding()
|
||||
letter_branding = create_letter_branding()
|
||||
|
||||
assert org.email_branding is None
|
||||
assert org.letter_branding is None
|
||||
|
||||
admin_request.post(
|
||||
'organisation.update_organisation',
|
||||
_data={
|
||||
'email_branding_id': str(email_branding.id),
|
||||
'letter_branding_id': str(letter_branding.id),
|
||||
},
|
||||
organisation_id=org.id,
|
||||
_expected_status=204
|
||||
)
|
||||
|
||||
assert org.email_branding == email_branding
|
||||
assert org.letter_branding == letter_branding
|
||||
|
||||
|
||||
def test_post_update_organisation_raises_400_on_existing_org_name(
|
||||
admin_request, sample_organisation):
|
||||
org = create_organisation()
|
||||
|
||||
Reference in New Issue
Block a user