mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 00:11:16 -05:00
Test for HTML response in the schema
Because we test for the other properties in the schema. Also sets `additionalProperties` to `False` so we’re forced to update the schemas if we make similar changes in the future. This means removing `created_by` from the test data because it’s not returned by the real response.
This commit is contained in:
@@ -66,9 +66,11 @@ post_template_preview_response = {
|
|||||||
"version": {"type": "integer"},
|
"version": {"type": "integer"},
|
||||||
"body": {"type": "string"},
|
"body": {"type": "string"},
|
||||||
"subject": {"type": ["string", "null"]},
|
"subject": {"type": ["string", "null"]},
|
||||||
"postage": {"type": "string"}
|
"postage": {"type": "string"},
|
||||||
|
"html": {"type": ["string", "null"]},
|
||||||
},
|
},
|
||||||
"required": ["id", "type", "version", "body"]
|
"required": ["id", "type", "version", "body"],
|
||||||
|
"additionalProperties": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,17 +71,16 @@ valid_json_post_response = {
|
|||||||
'id': str(uuid.uuid4()),
|
'id': str(uuid.uuid4()),
|
||||||
'type': 'email',
|
'type': 'email',
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'created_by': 'someone@test.com',
|
'body': 'some body',
|
||||||
'body': 'some body'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
valid_json_post_response_with_optionals = {
|
valid_json_post_response_with_optionals = {
|
||||||
'id': str(uuid.uuid4()),
|
'id': str(uuid.uuid4()),
|
||||||
'type': 'email',
|
'type': 'email',
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'created_by': 'someone@test.com',
|
|
||||||
'body': "some body",
|
'body': "some body",
|
||||||
'subject': 'some subject'
|
'subject': 'some subject',
|
||||||
|
'html': '<p>some body</p>',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user