Parametrized privacy policy, unified and refined nine/non-nine landing pages (#89)

- move web sources to markdown
- integrate privacy policy template
- create and use chatmail.ini file to driving web-page generation 

Co-authored-by: missytake <missytake@systemli.org>

---------

Co-authored-by: missytake <missytake@systemli.org>
This commit is contained in:
holger krekel
2023-12-07 13:52:00 +01:00
committed by GitHub
parent 960bc1599b
commit c67fb69af2
19 changed files with 2252 additions and 161 deletions

39
tests/test_helpers.py Normal file
View File

@@ -0,0 +1,39 @@
import textwrap
from deploy_chatmail import build_htmlj2_from_markdown, get_ini_settings
def test_markdown(tmp_path):
path = tmp_path.joinpath("privacy.md")
path.write_text("# privacy policy")
build_htmlj2_from_markdown(path)
output = path.with_name("privacy.html.j2")
assert output.exists()
print(output.read_text())
def test_get_settings(tmp_path):
inipath = tmp_path.joinpath("chatmail.ini")
inipath.write_text(
textwrap.dedent(
"""\
[config]
privacy_postal =
address-line1
address-line2
privacy_mail = privacy@example.org
privacy_pdo =
address-line3
"""
)
)
d = get_ini_settings("x.testrun.org", inipath)
assert d["privacy_postal"] == "address-line1\naddress-line2"
assert d["privacy_mail"] == "privacy@example.org"
assert d["privacy_pdo"] == "address-line3"
assert d["mail_domain"] == "x.testrun.org"