mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 16:31:15 -05:00
Add JSON schema for updating template
We did not have a JSON schema for updating a template. Since we will remove the postage constraint from the templates table, this adds a JSON schema for updating a template so that we can use it to check that the postage is one of the allowed values.
This commit is contained in:
@@ -884,6 +884,19 @@ def test_update_template_reply_to_set_to_blank(client, notify_db_session):
|
||||
assert th.service_letter_contact_id is None
|
||||
|
||||
|
||||
def test_update_template_validates_postage(admin_request, sample_service_full_permissions):
|
||||
template = create_template(service=sample_service_full_permissions, template_type='letter')
|
||||
|
||||
response = admin_request.post(
|
||||
'template.update_template',
|
||||
service_id=sample_service_full_permissions.id,
|
||||
template_id=template.id,
|
||||
_data={"postage": "third"},
|
||||
_expected_status=400
|
||||
)
|
||||
assert 'postage invalid' in response['errors'][0]['message']
|
||||
|
||||
|
||||
def test_update_template_with_foreign_service_reply_to(client, sample_letter_template):
|
||||
auth_header = create_authorization_header()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user