Test case for account creation on preexisting alias

This commit is contained in:
François Poulain
2021-11-06 18:37:24 +01:00
parent ec14a1baff
commit 54d9a91610
+15
View File
@@ -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")