mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:05:17 -05:00
Add unit test for archiving a template with a template folder
This commit is contained in:
@@ -411,6 +411,27 @@ def test_should_be_able_to_archive_template(client, sample_template):
|
|||||||
assert Template.query.first().archived
|
assert Template.query.first().archived
|
||||||
|
|
||||||
|
|
||||||
|
def test_should_be_able_to_archive_template_should_remove_template_folders(
|
||||||
|
client, sample_service
|
||||||
|
):
|
||||||
|
template_folder = create_template_folder(service=sample_service)
|
||||||
|
template = create_template(service=sample_service, folder=template_folder)
|
||||||
|
|
||||||
|
data = {
|
||||||
|
'archived': True,
|
||||||
|
}
|
||||||
|
|
||||||
|
client.post(
|
||||||
|
f'/service/{sample_service.id}/template/{template.id}',
|
||||||
|
headers=[('Content-Type', 'application/json'), create_authorization_header()],
|
||||||
|
data=json.dumps(data)
|
||||||
|
)
|
||||||
|
|
||||||
|
updated_template = Template.query.get(template.id)
|
||||||
|
assert updated_template.archived
|
||||||
|
assert not updated_template.folder
|
||||||
|
|
||||||
|
|
||||||
def test_get_precompiled_template_for_service(
|
def test_get_precompiled_template_for_service(
|
||||||
client,
|
client,
|
||||||
notify_user,
|
notify_user,
|
||||||
|
|||||||
Reference in New Issue
Block a user