def test_allowed_parent_page_types(self): # SimplePage does not define any restrictions on parent page types # SimplePage is a valid parent page of SimplePage self.assertIn(ContentType.objects.get_for_model(SimplePage), SimplePage.allowed_parent_page_types()) # BusinessChild cannot be a parent of anything self.assertNotIn(ContentType.objects.get_for_model(BusinessChild), SimplePage.allowed_parent_page_types()) # StandardIndex does not allow anything as a parent self.assertNotIn(ContentType.objects.get_for_model(SimplePage), StandardIndex.allowed_parent_page_types()) self.assertNotIn(ContentType.objects.get_for_model(StandardIndex), StandardIndex.allowed_parent_page_types()) # BusinessSubIndex only allows BusinessIndex as a parent self.assertNotIn(ContentType.objects.get_for_model(SimplePage), BusinessSubIndex.allowed_parent_page_types()) self.assertIn(ContentType.objects.get_for_model(BusinessIndex), BusinessSubIndex.allowed_parent_page_types())
def test_allowed_parent_page_types(self): # SimplePage does not define any restrictions on parent page types # SimplePage is a valid parent page of SimplePage self.assertIn(ContentType.objects.get_for_model(SimplePage), SimplePage.allowed_parent_page_types()) # BusinessChild cannot be a parent of anything self.assertNotIn(ContentType.objects.get_for_model(BusinessChild), SimplePage.allowed_parent_page_types()) # StandardIndex does not allow anything as a parent self.assertNotIn(ContentType.objects.get_for_model(SimplePage), StandardIndex.allowed_parent_page_types()) self.assertNotIn(ContentType.objects.get_for_model(StandardIndex), StandardIndex.allowed_parent_page_types()) # BusinessSubIndex only allows BusinessIndex as a parent self.assertNotIn(ContentType.objects.get_for_model(SimplePage), BusinessSubIndex.allowed_parent_page_types()) self.assertIn(ContentType.objects.get_for_model(BusinessIndex), BusinessSubIndex.allowed_parent_page_types())
def test_allowed_parent_page_types(self): """ Same assertions as for test_allowed_parent_page_models - allowed_parent_page_types should mirror allowed_parent_page_models with ContentType objects rather than model classes """ with self.ignore_deprecation_warnings(): # SimplePage does not define any restrictions on parent page types # SimplePage is a valid parent page of SimplePage self.assertIn(get_ct(SimplePage), SimplePage.allowed_parent_page_types()) # BusinessChild cannot be a parent of anything self.assertNotIn(get_ct(BusinessChild), SimplePage.allowed_parent_page_types()) # BusinessNowherePage does not allow anything as a parent self.assertNotIn(get_ct(SimplePage), BusinessNowherePage.allowed_parent_page_types()) self.assertNotIn(get_ct(StandardIndex), BusinessNowherePage.allowed_parent_page_types()) # BusinessSubIndex only allows BusinessIndex as a parent self.assertNotIn(get_ct(SimplePage), BusinessSubIndex.allowed_parent_page_types()) self.assertIn(get_ct(BusinessIndex), BusinessSubIndex.allowed_parent_page_types())
def test_allowed_parent_page_types(self): """ Same assertions as for test_allowed_parent_page_models - allowed_parent_page_types should mirror allowed_parent_page_models with ContentType objects rather than model classes """ with self.ignore_deprecation_warnings(): # SimplePage does not define any restrictions on parent page types # SimplePage is a valid parent page of SimplePage self.assertIn(get_ct(SimplePage), SimplePage.allowed_parent_page_types()) # BusinessChild cannot be a parent of anything self.assertNotIn(get_ct(BusinessChild), SimplePage.allowed_parent_page_types()) # BusinessNowherePage does not allow anything as a parent self.assertNotIn(get_ct(SimplePage), BusinessNowherePage.allowed_parent_page_types()) self.assertNotIn(get_ct(StandardIndex), BusinessNowherePage.allowed_parent_page_types()) # BusinessSubIndex only allows BusinessIndex as a parent self.assertNotIn(get_ct(SimplePage), BusinessSubIndex.allowed_parent_page_types()) self.assertIn(get_ct(BusinessIndex), BusinessSubIndex.allowed_parent_page_types())