summaryrefslogtreecommitdiff
path: root/yaksh/test_views.py
diff options
context:
space:
mode:
authorankitjavalkar2021-01-11 10:08:48 +0530
committerGitHub2021-01-11 10:08:48 +0530
commit98124aaa624ea09e131b6e3563f78bc5d48061ad (patch)
tree52835b0f708d43d1f352a853cf672ca291d30444 /yaksh/test_views.py
parent30dd519ba7a5277348960a696f3a7cbd91f3f72f (diff)
parent49a494849a0498e309f6c97ec6ae6ab79961b87d (diff)
downloadonline_test-98124aaa624ea09e131b6e3563f78bc5d48061ad.tar.gz
online_test-98124aaa624ea09e131b6e3563f78bc5d48061ad.tar.bz2
online_test-98124aaa624ea09e131b6e3563f78bc5d48061ad.zip
Merge pull request #725 from ankitjavalkar/bugfix_08_06
Remove 'copy of' string in _create_lesson_copy()
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r--yaksh/test_views.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py
index c2fa4ac..b46a6d9 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -2168,7 +2168,8 @@ class TestCourses(TestCase):
# Teacher Login
# Given
# Add files to a lesson
- lesson_file = SimpleUploadedFile("file1.txt", b"Test")
+ file_content = b"Test"
+ lesson_file = SimpleUploadedFile("file1.txt", file_content)
django_file = File(lesson_file)
lesson_file_obj = LessonFile()
lesson_file_obj.lesson = self.lesson
@@ -2203,18 +2204,18 @@ class TestCourses(TestCase):
self.assertEqual(response.status_code, 200)
self.assertEqual(courses.last().creator, self.teacher)
self.assertEqual(courses.last().name, "Copy Of Python Course")
- self.assertEqual(module.name, "Copy of demo module")
+ self.assertEqual(module.name, "demo module")
self.assertEqual(module.creator, self.teacher)
self.assertEqual(module.order, 0)
self.assertEqual(len(units), 2)
- self.assertEqual(cloned_lesson.name, "Copy of demo lesson")
+ self.assertEqual(cloned_lesson.name, "demo lesson")
self.assertEqual(cloned_lesson.creator, self.teacher)
- self.assertEqual(cloned_quiz.description, "Copy of demo quiz")
+ self.assertEqual(cloned_quiz.description, "demo quiz")
self.assertEqual(cloned_quiz.creator, self.teacher)
self.assertEqual(cloned_qp.__str__(),
- "Question Paper for Copy of demo quiz")
- self.assertEqual(os.path.basename(expected_lesson_files[0].file.name),
- os.path.basename(actual_lesson_files[0].file.name))
+ "Question Paper for demo quiz")
+ self.assertTrue(expected_lesson_files.exists())
+ self.assertEquals(expected_lesson_files[0].file.read(), file_content)
for lesson_file in self.all_files:
file_path = lesson_file.file.path