Exemplo 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))
Exemplo 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
         ))
Exemplo n.º 3
0
 def test_xpaths(self, xpath, expected):
     response = views.tool_config(self.request)
     self.verify_response_value(response, xpath, expected)
Exemplo 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))
Exemplo 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')
Exemplo 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"')
Exemplo n.º 7
0
 def test_xpaths(self, xpath, expected):
     response = views.tool_config(self.request)
     self.verify_response_value(response, xpath, expected)
Exemplo 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
         ))
Exemplo 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'
     )
Exemplo 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"'
     )