Coverage for app/backend/src/tests/test_dump_emails.py: 100%
14 statements
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-10 03:41 +0000
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-10 03:41 +0000
1"""
2Renders sample emails for visual inspection.
4Output is written to test_artifacts/emails/ (gitignored) and picked up by CI, which
5publishes the browsable index.html to the preview environment.
6"""
8from pathlib import Path
10from couchers.email.dump_emails import dump_all
13def test_dump_email_samples(testconfig):
14 output_path = Path(__file__).resolve().parents[2] / "test_artifacts" / "emails"
15 rendered = dump_all(output_path)
17 assert rendered
18 index = output_path / "index.html"
19 assert index.exists()
20 assert (output_path / "attachment_imgs" / "logo-with-couchers.org-small.png").exists()
21 for variation in rendered:
22 assert variation.subjects
23 for locale in variation.subjects:
24 assert (output_path / locale / variation.html_filename).exists()
25 assert (output_path / locale / variation.plaintext_filename).exists()