Skip to content

Commit

Permalink
model test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PJDeSmijter committed Mar 12, 2024
1 parent d2e8b10 commit 2f06aee
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/pigeonhole/tests/test_models/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class GroupTestCase(TestCase):
def setUp(self):
# Create teacher user
teacher = User.objects.create(
id=1,
username="teacher_username",
email="[email protected]",
first_name="Kermit",
Expand All @@ -21,6 +22,7 @@ def setUp(self):

# Create student user
student = User.objects.create(
id=2,
username="student_username",
email="[email protected]",
first_name="Miss",
Expand All @@ -30,6 +32,7 @@ def setUp(self):

# Create a second student user
student2 = User.objects.create(
id=3,
username="student_username2",
email="[email protected]",
first_name="Fozzie",
Expand Down Expand Up @@ -67,14 +70,14 @@ def test_group_project_relation(self):

def test_group_student_relation(self):
group = Group.objects.get(group_nr=1)
student = User.objects.get(id=1)
student2 = User.objects.get(id=2)
student = User.objects.get(id=2)
student2 = User.objects.get(id=3)
self.assertIn(student, group.user.all())
self.assertIn(student2, group.user.all())

def test_group_final_score(self):
group = Group.objects.get(group_nr=1)
self.assertEqual(group.final_score, 0)
self.assertEqual(group.final_score, None)

def test_group_group_nr(self):
group = Group.objects.get(group_nr=1)
Expand Down

0 comments on commit 2f06aee

Please sign in to comment.