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")
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")