コード例 #1
0
 def test_django_prior_to_22(self):
     mock_request = mock.MagicMock(spec=["META"])
     get_request_header(mock_request, "x-foo-bar", "HTTP_X_FOO_BAR")
     mock_request.META.get.assert_called_once_with("HTTP_X_FOO_BAR")
コード例 #2
0
 def test_django_22_or_higher(self):
     mock_request = mock.MagicMock(spec=["headers"])
     get_request_header(mock_request, "x-foo-bar", "HTTP_X_FOO_BAR")
     mock_request.headers.get.assert_called_once_with("x-foo-bar")