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 )
def test_should_parse_links_if_html(self): self.assertTrue( ParseLinksMiddleware.should_parse_links( request_path='/foo/bar', response_content_type='text/html'))
def test_should_not_parse_links_if_empty(self): self.assertFalse( ParseLinksMiddleware.should_parse_links(request_path='/foo/bar', response_content_type=''))
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'))
def test_should_parse_links_if_html(self): self.assertTrue(ParseLinksMiddleware.should_parse_links( request_path='/foo/bar', response_content_type='text/html' ))
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' ))