mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 16:31:15 -05:00
Delete redundant test
Not needed now that the test above this one is parametrized.
This commit is contained in:
@@ -32,23 +32,6 @@ def test_create_template(sample_service, sample_user, template_type, subject):
|
||||
assert dao_get_all_templates_for_service(sample_service.id)[0].name == 'Sample Template'
|
||||
|
||||
|
||||
def test_create_email_template(sample_service, sample_user):
|
||||
data = {
|
||||
'name': 'Sample Template',
|
||||
'template_type': "email",
|
||||
'subject': "subject",
|
||||
'content': "Template content",
|
||||
'service': sample_service,
|
||||
'created_by': sample_user
|
||||
}
|
||||
template = Template(**data)
|
||||
dao_create_template(template)
|
||||
|
||||
assert Template.query.count() == 1
|
||||
assert len(dao_get_all_templates_for_service(sample_service.id)) == 1
|
||||
assert dao_get_all_templates_for_service(sample_service.id)[0].name == 'Sample Template'
|
||||
|
||||
|
||||
def test_update_template(sample_service, sample_user):
|
||||
data = {
|
||||
'name': 'Sample Template',
|
||||
|
||||
@@ -49,36 +49,6 @@ def test_should_create_a_new_template_for_a_service(
|
||||
assert not json_resp['data']['subject']
|
||||
|
||||
|
||||
def test_should_create_a_new_email_template_for_a_service(notify_api, sample_user, sample_service):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'name': 'my template',
|
||||
'template_type': 'email',
|
||||
'subject': 'subject',
|
||||
'content': 'template <b>content</b>',
|
||||
'service': str(sample_service.id),
|
||||
'created_by': str(sample_user.id)
|
||||
}
|
||||
data = json.dumps(data)
|
||||
auth_header = create_authorization_header()
|
||||
|
||||
response = client.post(
|
||||
'/service/{}/template'.format(sample_service.id),
|
||||
headers=[('Content-Type', 'application/json'), auth_header],
|
||||
data=data
|
||||
)
|
||||
assert response.status_code == 201
|
||||
json_resp = json.loads(response.get_data(as_text=True))
|
||||
assert json_resp['data']['name'] == 'my template'
|
||||
assert json_resp['data']['template_type'] == 'email'
|
||||
assert json_resp['data']['content'] == 'template content'
|
||||
assert json_resp['data']['service'] == str(sample_service.id)
|
||||
assert json_resp['data']['subject'] == 'subject'
|
||||
assert json_resp['data']['version'] == 1
|
||||
assert json_resp['data']['id']
|
||||
|
||||
|
||||
def test_should_be_error_if_service_does_not_exist_on_create(notify_api, sample_user, fake_uuid):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
|
||||
Reference in New Issue
Block a user