예제 #1
0
 def test_default_header_name(self):
     # default value for settings.CSRF_HEADER_NAME
     setting = 'HTTP_X_CSRFTOKEN'
     result = convert_header_name(setting)
     self.assertEqual(result, 'x-csrftoken')
예제 #2
0
 def test_custom_header_name(self):
     setting = 'HTTP_X_XSRF_TOKEN'
     result = convert_header_name(setting)
     self.assertEqual(result, 'x-xsrf-token')
예제 #3
0
 def test_custom_header_without_http_prefix(self):
     setting = 'X_XSRF_TOKEN'
     result = convert_header_name(setting)
     self.assertEqual(result, 'x-xsrf-token')