diff options
author | adityacp | 2018-02-27 15:41:08 +0530 |
---|---|---|
committer | adityacp | 2018-02-27 15:41:08 +0530 |
commit | 0ae21e437775b056d346311bd9f50220e5d9fb28 (patch) | |
tree | d1b1ff94bbb85c89f54c942c0403d6041db05a3b /yaksh/test_views.py | |
parent | 333859a8c1ab57e70ea57e92a22eaac6a1a1c0ac (diff) | |
download | online_test-0ae21e437775b056d346311bd9f50220e5d9fb28.tar.gz online_test-0ae21e437775b056d346311bd9f50220e5d9fb28.tar.bz2 online_test-0ae21e437775b056d346311bd9f50220e5d9fb28.zip |
Change in models.py, views.py, urls.py, test_views.py, courses.html
- Allow only deep cloning of a course
- Remove tests for shallow course clone
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r-- | yaksh/test_views.py | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py index 8695479..faac617 100644 --- a/yaksh/test_views.py +++ b/yaksh/test_views.py @@ -1870,8 +1870,7 @@ class TestCourses(TestCase): response = self.client.get( reverse('yaksh:duplicate_course', - kwargs={"course_id": self.user2_course.id, - "copy_type": "shallow"}), + kwargs={"course_id": self.user2_course.id}), follow=True ) self.assertEqual(response.status_code, 404) @@ -1885,8 +1884,7 @@ class TestCourses(TestCase): # Denies teacher not added in the course response = self.client.get( reverse('yaksh:duplicate_course', - kwargs={"course_id": self.user2_course.id, - "copy_type": "shallow"}), + kwargs={"course_id": self.user2_course.id}), follow=True ) err_msg = "You do not have permissions" @@ -1894,29 +1892,6 @@ class TestCourses(TestCase): self.assertTemplateUsed(response, "yaksh/complete.html") self.assertIn(err_msg, response.context['message']) - # Moderator/Course creator login - self.client.login( - username=self.user2.username, - password=self.user2_plaintext_pass - ) - - # Allows creator to duplicate the course - response = self.client.get( - reverse('yaksh:duplicate_course', - kwargs={"course_id": self.user2_course.id, - "copy_type": "shallow"}), - follow=True - ) - - self.assertEqual(response.status_code, 200) - courses = Course.objects.filter( - creator=self.user2).order_by("id") - self.assertEqual(courses.count(), 2) - self.assertEqual(courses.last().creator, self.user2) - self.assertEqual(courses.last().name, "Copy Of Java Course") - self.assertEqual(courses.last().get_learning_modules()[0].id, - self.user2_course.get_learning_modules()[0].id) - # Test clone/duplicate courses and create copies of modules and units # Teacher Login @@ -1936,8 +1911,7 @@ class TestCourses(TestCase): ) response = self.client.get( reverse('yaksh:duplicate_course', - kwargs={"course_id": self.user1_course.id, - "copy_type": "deep"}), + kwargs={"course_id": self.user1_course.id}), follow=True ) |