def test_gz_without_request(self):
     """
     Validate that when the request is not passed to the tag, we default to
     no gzip compression.
     """
     context = {}
     self.assertEqual(gz(context), '')
Пример #2
0
 def test_gz_without_request(self):
     """
     Validate that when the request is not passed to the tag, we default to
     no gzip compression.
     """
     context = {}
     self.assertEqual(gz(context), '')
 def test_gz_without_gzip_encoding_accepted(self):
     """
     Validate that when the request does not specify gzip is accepted, we
     do not append .gz to links.
     """
     # Mock the context object, which should include a request.
     request = lambda: None
     request.META = {'HTTP_ACCEPT_ENCODING': ''}
     context = {'request': request}
     self.assertEqual(gz(context), '')
Пример #4
0
 def test_gz_without_gzip_encoding_accepted(self):
     """
     Validate that when the request does not specify gzip is accepted, we
     do not append .gz to links.
     """
     # Mock the context object, which should include a request.
     request = lambda: None
     request.META = {'HTTP_ACCEPT_ENCODING': ''}
     context = {'request': request}
     self.assertEqual(gz(context), '')