def test_check_ancestors_valid_ancestors(self, scrape): # check_ancestors returns the page when it has valid ancestors page = MockPage(parent_path='/home/legal-resources/something/', ancestor_path='/home/legal-resources/') p = search.check_ancestors(page) self.assertEqual(p, page)
def test_check_ancestors_invalid_ancestors(self, scrape): # check_ancestors returns None when it has an invalid parent and ancestors page = MockPage(parent_path='/fake/', ancestor_path='/fake/fake/') p = search.check_ancestors(page) self.assertEqual(p, None)
def test_check_ancestors_valid_parent(self, scrape): # check_ancestors returns the page when it has a valid direct parent p = search.check_ancestors(self.page) self.assertEqual(p, self.page)