From 72528b68daebc5a61d5aab13845eab20669b7580 Mon Sep 17 00:00:00 2001 From: Drikus Roor Date: Tue, 27 Feb 2024 16:42:23 +0100 Subject: [PATCH] fix: Refactor test_congosamediff.py to use Django TestCase and add assertions for experiment rounds --- backend/experiment/rules/tests/test_congosamediff.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/experiment/rules/tests/test_congosamediff.py b/backend/experiment/rules/tests/test_congosamediff.py index b2ca3b22b..990962d30 100644 --- a/backend/experiment/rules/tests/test_congosamediff.py +++ b/backend/experiment/rules/tests/test_congosamediff.py @@ -1,4 +1,4 @@ -from unittest import TestCase +from django.test import TestCase from experiment.models import Experiment from participant.models import Participant @@ -12,7 +12,10 @@ class CongoSameDiffTest(TestCase): def setUpTestData(self): self.participant = Participant.objects.create() self.playlist = Playlist.objects.create(name='CongoSameDiff') - self.experiment = Experiment.objects.create(name='CongoSameDiff', rounds=5) + self.experiment = Experiment.objects.create( + name='CongoSameDiff', + rounds=5, + ) self.session = Session.objects.create( experiment=self.experiment, participant=self.participant, @@ -20,4 +23,5 @@ def setUpTestData(self): ) def test_initializes_correctly(self): - assert self.experiment.name == 'CongoSameDiff' \ No newline at end of file + assert self.experiment.name == 'CongoSameDiff' + assert self.experiment.rounds == 5 \ No newline at end of file