Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adityacp committed Dec 4, 2020
1 parent c5b26a3 commit abee2fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions stats/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_log_counter(self):
def test_get_current_time(self):
# Given
tracker = self.tracker
expected_time = 'just started'
expected_time = '00:00:00'

# When
current_time = tracker.get_current_time()
Expand All @@ -81,7 +81,7 @@ def test_get_current_time(self):
def test_get_video_duration(self):
# Given
tracker = self.tracker
expected_duration = 'will be available after 25% completion'
expected_duration = '00:00:00'

# When
duration = tracker.get_video_duration()
Expand Down Expand Up @@ -117,7 +117,7 @@ def test_set_current_time(self):
def test_get_percentage_complete(self):
# Given
tracker = self.tracker
expected_percentage = 'less than 25%'
expected_percentage = 0

# When
percentage = tracker.get_percentage_complete()
Expand All @@ -126,7 +126,7 @@ def test_get_percentage_complete(self):
self.assertEqual(percentage, expected_percentage)

# Given
expected_percentage = 'approx 75 %'
expected_percentage = 75

# When
tracker.set_current_time('00:03:00')
Expand Down
4 changes: 2 additions & 2 deletions stats/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ def test_allow_moderator_view_tracking(self):
self.assertEqual(response_data.get('total'), 1)
expected_tracker = list(TrackLesson.objects.filter(
user_id=self.student.id, course_id=self.course.id,
lesson_id=self.lesson.id).values_list("id", flat=True))
lesson_id=self.lesson.id))
obtained_tracker = list(response_data.get(
'objects').object_list.values_list("id", flat=True))
'objects').object_list)
self.assertEqual(obtained_tracker, expected_tracker)

0 comments on commit abee2fe

Please sign in to comment.