mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
Test that template history updates created by
This commit is contained in:
@@ -340,8 +340,13 @@ def test_must_have_a_subject_on_an_email_or_letter_template(client, sample_user,
|
|||||||
|
|
||||||
|
|
||||||
def test_update_should_update_a_template(client, sample_user):
|
def test_update_should_update_a_template(client, sample_user):
|
||||||
|
|
||||||
service = create_service(service_permissions=[LETTER_TYPE])
|
service = create_service(service_permissions=[LETTER_TYPE])
|
||||||
template = create_template(service, template_type="letter", postage="second")
|
template = create_template(service, template_type="letter", postage="second")
|
||||||
|
|
||||||
|
assert template.created_by == service.created_by
|
||||||
|
assert template.created_by != sample_user
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'content': 'my template has new content, swell!',
|
'content': 'my template has new content, swell!',
|
||||||
'created_by': str(sample_user.id),
|
'created_by': str(sample_user.id),
|
||||||
@@ -366,6 +371,14 @@ def test_update_should_update_a_template(client, sample_user):
|
|||||||
assert update_json_resp['data']['template_type'] == template.template_type
|
assert update_json_resp['data']['template_type'] == template.template_type
|
||||||
assert update_json_resp['data']['version'] == 2
|
assert update_json_resp['data']['version'] == 2
|
||||||
|
|
||||||
|
assert update_json_resp['data']['created_by'] == str(sample_user.id)
|
||||||
|
assert [
|
||||||
|
template.created_by_id for template in TemplateHistory.query.all()
|
||||||
|
] == [
|
||||||
|
service.created_by.id,
|
||||||
|
sample_user.id,
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_should_be_able_to_archive_template(client, sample_template):
|
def test_should_be_able_to_archive_template(client, sample_template):
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user