summaryrefslogtreecommitdiff
path: root/stats
diff options
context:
space:
mode:
authoradityacp2020-12-04 11:10:12 +0530
committeradityacp2020-12-04 11:10:12 +0530
commitabee2fe4085f42ca3b92192d59150a780a765c26 (patch)
treefa6321676431fc84beef21279a380760c109504f /stats
parentc5b26a3b0d7e29f9813aa4fcdcbcaaa66945b86d (diff)
downloadonline_test-abee2fe4085f42ca3b92192d59150a780a765c26.tar.gz
online_test-abee2fe4085f42ca3b92192d59150a780a765c26.tar.bz2
online_test-abee2fe4085f42ca3b92192d59150a780a765c26.zip
Fix tests
Diffstat (limited to 'stats')
-rw-r--r--stats/test_models.py8
-rw-r--r--stats/tests.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/stats/test_models.py b/stats/test_models.py
index 5506a64..7f84330 100644
--- a/stats/test_models.py
+++ b/stats/test_models.py
@@ -70,7 +70,7 @@ class TrackLessonTestCase(TestCase):
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()
@@ -81,7 +81,7 @@ class TrackLessonTestCase(TestCase):
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()
@@ -117,7 +117,7 @@ class TrackLessonTestCase(TestCase):
def test_get_percentage_complete(self):
# Given
tracker = self.tracker
- expected_percentage = 'less than 25%'
+ expected_percentage = 0
# When
percentage = tracker.get_percentage_complete()
@@ -126,7 +126,7 @@ class TrackLessonTestCase(TestCase):
self.assertEqual(percentage, expected_percentage)
# Given
- expected_percentage = 'approx 75 %'
+ expected_percentage = 75
# When
tracker.set_current_time('00:03:00')
diff --git a/stats/tests.py b/stats/tests.py
index c256feb..540ff4d 100644
--- a/stats/tests.py
+++ b/stats/tests.py
@@ -131,8 +131,8 @@ class TestTrackLesson(TestCase):
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)