예제 #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
     )
예제 #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
     )
예제 #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'))
예제 #4
0
 def test_should_not_parse_links_if_empty(self):
     self.assertFalse(
         ParseLinksMiddleware.should_parse_links(request_path='/foo/bar',
                                                 response_content_type=''))
예제 #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'))
예제 #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'
     ))
예제 #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'
     ))