Skip to content

Commit

Permalink
fix: backend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EwoutV committed May 23, 2024
1 parent 889757a commit e59cf5b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions backend/api/tests/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from django.urls import reverse
from rest_framework.test import APITestCase

from ypovoli import settings


class GroupModelTests(APITestCase):
def setUp(self) -> None:
Expand Down Expand Up @@ -39,7 +41,7 @@ def test_group_detail_view(self):
content_json = json.loads(response.content.decode("utf-8"))

self.assertEqual(int(content_json["id"]), group.id)
self.assertEqual(content_json["project"]["id"], group.project.id)
self.assertEqual(content_json["project"], settings.TESTING_BASE_LINK + reverse("project-detail", args=[str(project.id)]))
self.assertEqual(content_json["score"], group.score)

def test_group_project(self):
Expand Down Expand Up @@ -70,11 +72,7 @@ def test_group_project(self):
# Parse the JSON content from the response
content_json = content_json["project"]

self.assertEqual(content_json["name"], project.name)
self.assertEqual(content_json["description"], project.description)
self.assertEqual(content_json["visible"], project.visible)
self.assertEqual(content_json["archived"], project.archived)
self.assertEqual(content_json["course"]["id"], course.id)
self.assertEqual(content_json, settings.TESTING_BASE_LINK + reverse("project-detail", args=[str(project.id)]))

def test_group_students(self):
"""Able to retrieve students details of a group."""
Expand Down

0 comments on commit e59cf5b

Please sign in to comment.