Example #1
0
 def check_should_parse_links_for_path(self, path, expected):
     self.assertEqual(
         ParseLinksMiddleware.should_parse_links(
             request_path=path,
             response_content_type='text/html'
         ),
         expected
     )
Example #2
0
 def check_should_parse_links_for_path(self, path, expected):
     self.assertEqual(
         ParseLinksMiddleware.should_parse_links(
             request_path=path,
             response_content_type='text/html'
         ),
         expected
     )
Example #3
0
 def test_should_parse_links_if_html(self):
     self.assertTrue(
         ParseLinksMiddleware.should_parse_links(
             request_path='/foo/bar', response_content_type='text/html'))
Example #4
0
 def test_should_not_parse_links_if_empty(self):
     self.assertFalse(
         ParseLinksMiddleware.should_parse_links(request_path='/foo/bar',
                                                 response_content_type=''))
Example #5
0
 def test_should_not_parse_links_if_non_html(self):
     self.assertFalse(
         ParseLinksMiddleware.should_parse_links(
             request_path='/foo/bar',
             response_content_type='application/json'))
Example #6
0
 def test_should_parse_links_if_html(self):
     self.assertTrue(ParseLinksMiddleware.should_parse_links(
         request_path='/foo/bar',
         response_content_type='text/html'
     ))
Example #7
0
 def test_should_not_parse_links_if_non_html(self):
     self.assertFalse(ParseLinksMiddleware.should_parse_links(
         request_path='/foo/bar',
         response_content_type='application/json'
     ))