コード例 #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')
コード例 #2
0
ファイル: test_views.py プロジェクト: penzance/edx-in-canvas
 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'
     )
コード例 #3
0
ファイル: test_views.py プロジェクト: penzance/edx-in-canvas
 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'
     )
コード例 #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')