From 7081bbe14ad872cc09c1fb824c567dc847972612 Mon Sep 17 00:00:00 2001 From: moanos Date: Mon, 25 Mar 2024 10:47:24 +0100 Subject: [PATCH] test: Add mail and trust level to test users --- .../management/commands/populate_db.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/fellchensammlung/management/commands/populate_db.py b/src/fellchensammlung/management/commands/populate_db.py index 2470b54..6c35ef5 100644 --- a/src/fellchensammlung/management/commands/populate_db.py +++ b/src/fellchensammlung/management/commands/populate_db.py @@ -58,7 +58,15 @@ class Command(BaseCommand): public_comment="A moderator has deleted the reported content") User.objects.create_user('test', password='foobar') - User.objects.create_superuser(username="admin", password="admin") + u_admin1 = User.objects.create_superuser(username="admin", password="admin", email="admin1@example.org") + admin1 = Member.objects.get(user=u_admin1) + admin1.trust_level = Member.ADMIN + admin1.save() + + u_mod1 = User.objects.create_user(username="mod1", password="mod", email="mod1@example.org") + mod1 = Member.objects.get(user=u_mod1) + mod1.trust_level = Member.MODERATOR + mod1.save() def handle(self, *args, **options): self.populate_db()