From 54d9a91610b5d1558eba0b805d6e16393f937b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Poulain?= Date: Sat, 6 Nov 2021 17:06:04 +0100 Subject: [PATCH] Test case for account creation on preexisting alias --- modoboa/admin/tests/test_account.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modoboa/admin/tests/test_account.py b/modoboa/admin/tests/test_account.py index 0c4bb27e7..00ed56684 100644 --- a/modoboa/admin/tests/test_account.py +++ b/modoboa/admin/tests/test_account.py @@ -119,6 +119,21 @@ class AccountTestCase(ModoTestCase): account = User.objects.get(username=values["username"]) self.assertEqual(account.language, "fr") + def test_create_account_with_existing_alias(self): + alias = models.Alias.objects.get(address="alias@test.com") + alias.set_recipients(["user@external.com"]) + values = { + "email": "tester@test.com", + "username": "tester@test.com", + "role": "SimpleUsers", + "random_password": "on", + "quota_act": True, + "is_active": True, + "stepid": "step2", + "aliases": "alias@test.com", + } + self.ajax_post(reverse("admin:account_add"), values) + def test_aliases_update_on_disable(self): """Check if aliases are updated when account is disabled.""" account = User.objects.get(username="user@test.com")