Example #1
0
 def test_main_with_missing_course(self):
     with patch('edx2canvas.models.EdxCourse.objects.get') as get_mock:
         get_mock.side_effect = models.EdxCourse.DoesNotExist()
         response = views.get_edx_course(self.request)
     self.assertEqual(
         response.status_code, 404,
         'Expected Not Found status code when edX course does not exist')
Example #2
0
 def test_main_with_missing_course_id(self):
     del self.request.GET['edx_course_id']
     response = views.get_edx_course(self.request)
     self.assertEqual(
         response.status_code, 400,
         'Expected Bad Request status code when LTI_LAUNCH not in session'
     )
Example #3
0
 def test_main_with_missing_course(self):
     with patch('edx2canvas.models.EdxCourse.objects.get') as get_mock:
         get_mock.side_effect = models.EdxCourse.DoesNotExist()
         response = views.get_edx_course(self.request)
     self.assertEqual(
         response.status_code, 404,
         'Expected Not Found status code when edX course does not exist'
     )
Example #4
0
 def test_main_with_missing_course_id(self):
     del self.request.GET['edx_course_id']
     response = views.get_edx_course(self.request)
     self.assertEqual(
         response.status_code, 400,
         'Expected Bad Request status code when LTI_LAUNCH not in session')