Skip to content

Commit

Permalink
fix: Refactor test_congosamediff.py to use Django TestCase and add as…
Browse files Browse the repository at this point in the history
…sertions for experiment rounds
  • Loading branch information
drikusroor committed Feb 27, 2024
1 parent c5835e1 commit 72528b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backend/experiment/rules/tests/test_congosamediff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from unittest import TestCase
from django.test import TestCase

from experiment.models import Experiment
from participant.models import Participant
Expand All @@ -12,12 +12,16 @@ 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,
playlist=self.playlist
)

def test_initializes_correctly(self):
assert self.experiment.name == 'CongoSameDiff'
assert self.experiment.name == 'CongoSameDiff'
assert self.experiment.rounds == 5

0 comments on commit 72528b6

Please sign in to comment.