(e2e) add specific accounts for testing

This creates a bunch of accounts with various profiles
to allow testing in a specific "mode"
This commit is contained in:
Quentin BEY
2024-11-13 16:54:54 +01:00
committed by BEY Quentin
parent 6123e11dd4
commit 59f3499799
13 changed files with 394 additions and 48 deletions

View File

@@ -28,13 +28,22 @@ def test_commands_create_demo():
"""The create_demo management command should create objects as expected."""
call_command("create_demo")
assert (
models.User.objects.count() == TEST_NB_OBJECTS["users"] + 3
) # Monique Test, Jeanne Test and Jean Something (quick fix for e2e)
# Monique Test, Jeanne Test and Jean Something (quick fix for e2e)
# 3 user with team rights
# 3 user with domain rights
# 3 x 3 user with both rights
assert models.User.objects.count() == TEST_NB_OBJECTS["users"] + 3 + 3 + 3 + 9
assert models.Team.objects.count() == TEST_NB_OBJECTS["teams"]
assert models.TeamAccess.objects.count() >= TEST_NB_OBJECTS["teams"]
assert mailbox_models.MailDomain.objects.count() == TEST_NB_OBJECTS["domains"]
assert mailbox_models.MailDomainAccess.objects.count() == TEST_NB_OBJECTS["domains"]
# 3 domain access for each user with domain rights
# 3 x 3 domain access for each user with both rights
assert (
mailbox_models.MailDomainAccess.objects.count()
== TEST_NB_OBJECTS["domains"] + 3 + 9
)
def test_commands_createsuperuser():