Don't write files from the test suite (#1020)
The lemur_email.tests.test_render test would fail when running unittests from a read-only source tree.
This commit is contained in:
parent
ba4de07ad8
commit
7a84f38db9
|
@ -19,19 +19,15 @@ def test_render(certificate, endpoint):
|
||||||
|
|
||||||
template = env.get_template('{}.html'.format('expiration'))
|
template = env.get_template('{}.html'.format('expiration'))
|
||||||
|
|
||||||
with open(os.path.join(dir_path, 'expiration-rendered.html'), 'w') as f:
|
body = template.render(dict(message=data, hostname='lemur.test.example.com'))
|
||||||
body = template.render(dict(message=data, hostname='lemur.test.example.com'))
|
|
||||||
f.write(body)
|
|
||||||
|
|
||||||
template = env.get_template('{}.html'.format('rotation'))
|
template = env.get_template('{}.html'.format('rotation'))
|
||||||
|
|
||||||
certificate.endpoints.append(endpoint)
|
certificate.endpoints.append(endpoint)
|
||||||
|
|
||||||
with open(os.path.join(dir_path, 'rotation-rendered.html'), 'w') as f:
|
body = template.render(
|
||||||
body = template.render(
|
dict(
|
||||||
dict(
|
certificate=certificate_notification_output_schema.dump(certificate).data,
|
||||||
certificate=certificate_notification_output_schema.dump(certificate).data,
|
hostname='lemur.test.example.com'
|
||||||
hostname='lemur.test.example.com'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
f.write(body)
|
)
|
||||||
|
|
Loading…
Reference in New Issue