(plugin) add CommuneCreation plugin

Add test for domain spec from Dimail
This commit is contained in:
Laurent Bossavit
2025-01-21 15:45:21 +01:00
committed by Laurent Bossavit
parent 34c9dc6cd7
commit 57fd15100e
2 changed files with 25 additions and 3 deletions

View File

@@ -90,10 +90,25 @@ def test_tasks_on_commune_creation_include_dimail_domain_creation():
assert tasks[1].params == {
"name": "merlaut",
"delivery": "virtual",
"features": ["webmail"],
"features": ["webmail", "mailbox"],
"context_name": "merlaut",
}
assert (
tasks[1].headers["Authorization"]
== f"Basic: {settings.MAIL_PROVISIONING_API_CREDENTIALS}"
)
def test_tasks_on_commune_creation_include_fetching_spec():
"""Test the third task in commune creation: asking Dimail for the spec"""
plugin = CommuneCreation()
name = "Loc-Eguiner"
tasks = plugin.complete_commune_creation(name)
assert tasks[2].base == settings.MAIL_PROVISIONING_API_URL
assert tasks[2].url == "/domains/loc-eguiner.collectivite.fr/spec"
assert tasks[2].method == "GET"
assert (
tasks[2].headers["Authorization"]
== f"Basic: {settings.MAIL_PROVISIONING_API_CREDENTIALS}"
)