Esempio n. 1
0
 def test_insecure_config_request(self):
     self.request.is_secure = MagicMock(return_value=False)
     self.request.META['SERVER_PORT'] = 80
     response = views.tool_config(self.request)
     self.verify_response_value(
         response, 'lti:launch_url',
         'http://{}{}'.format(self.server_name, self.deployment_path))
Esempio n. 2
0
 def test_insecure_config_request(self):
     self.request.is_secure = MagicMock(return_value=False)
     self.request.META['SERVER_PORT'] = 80
     response = views.tool_config(self.request)
     self.verify_response_value(
         response, 'lti:launch_url', 'http://{}{}'.format(
             self.server_name, self.deployment_path
         ))
Esempio n. 3
0
 def test_xpaths(self, xpath, expected):
     response = views.tool_config(self.request)
     self.verify_response_value(response, xpath, expected)
Esempio n. 4
0
 def test_secure_config_request(self):
     response = views.tool_config(self.request)
     self.verify_response_value(
         response, 'lti:launch_url',
         'https://{}{}'.format(self.server_name, self.deployment_path))
Esempio n. 5
0
 def test_response_status_code(self):
     response = views.tool_config(self.request)
     self.assertEqual(response.status_code, 200,
                      'Expected OK status code for tool config')
Esempio n. 6
0
 def test_response_content_type(self):
     response = views.tool_config(self.request)
     self.assertEqual(
         response['Content-Type'], 'text/xml',
         'Expected tool config Content-Type header to be "text/xml"')
Esempio n. 7
0
 def test_xpaths(self, xpath, expected):
     response = views.tool_config(self.request)
     self.verify_response_value(response, xpath, expected)
Esempio n. 8
0
 def test_secure_config_request(self):
     response = views.tool_config(self.request)
     self.verify_response_value(
         response, 'lti:launch_url', 'https://{}{}'.format(
             self.server_name, self.deployment_path
         ))
Esempio n. 9
0
 def test_response_status_code(self):
     response = views.tool_config(self.request)
     self.assertEqual(
         response.status_code, 200, 'Expected OK status code for tool config'
     )
Esempio n. 10
0
 def test_response_content_type(self):
     response = views.tool_config(self.request)
     self.assertEqual(
         response['Content-Type'], 'text/xml',
         'Expected tool config Content-Type header to be "text/xml"'
     )