def site(): site = SiteFactory(is_default_site=True) page1 = HomePageFactory(parent=site.root_page, slug='page-1') page2 = HomePageFactory(parent=site.root_page, slug='page-2') SpecialPageFactory(parent=page1, slug='page-1-1') SpecialPageFactory(parent=page2, slug='page-2-1') return site
def site(): root_page = ContentPageFactory(parent=None, slug="") site = SiteFactory(is_default_site=True, root_page=root_page) page1 = ContentPageFactory(parent=root_page, slug="content-page") page2 = TaggableContentPageFactory(parent=root_page, slug="taggable-content-page") ContentPageFactory(parent=page1, slug="content-page-child") TaggableContentPageFactory(parent=page2, slug="taggable-content-page-child") return site
def site(): root_page = ContentPageFactory(parent=None, slug="") site = SiteFactory(is_default_site=True, root_page=root_page) page1 = ContentPageFactory(parent=root_page, slug="page-1") page2 = ContentPageFactory(parent=root_page, slug="page-2") ContentPageFactory(parent=page1, slug="page-1-1") ContentPageFactory(parent=page2, slug="page-2-1") return site
def multisite(site): from tests.factories.page import PageFactory from tests.factories.site import SiteFactory page_2 = PageFactory(path='00010003', slug='page-2') site_2 = SiteFactory(hostname='site_2', is_default_site=False, root_page=page_2) page_3 = PageFactory(path='00010004', slug='page-3') site_3 = SiteFactory(hostname='site_3', is_default_site=False, root_page=page_3) page_4 = PageFactory(path='00010005', slug='page-4') site_4 = SiteFactory(hostname='site_4', is_default_site=False, root_page=page_4) return [site, site_2, site_3, site_4]
def site(): root_page = ContentPageFactory(parent=None, slug='') site = SiteFactory(is_default_site=True, root_page=root_page) page1 = ContentPageFactory(parent=root_page, slug='page-1') page2 = ContentPageFactory(parent=root_page, slug='page-2') ContentPageFactory(parent=page1, slug='page-1-1') ContentPageFactory(parent=page2, slug='page-2-1') RegularPageFactory(parent=root_page, slug='regular') return site
def site(): try: from wagtail.core.models import Locale # noqa from tests.factories.locale import LocaleFactory LocaleFactory() except: # noqa: E722 pass root_page = ContentPageFactory(parent=None, slug="") site = SiteFactory(is_default_site=True, root_page=root_page) page1 = ContentPageFactory(parent=root_page, slug="content-page") page2 = TaggableContentPageFactory(parent=root_page, slug="taggable-content-page") ContentPageFactory(parent=page1, slug="content-page-child") TaggableContentPageFactory(parent=page2, slug="taggable-content-page-child") return site
def setup(self): """ Sets up a site root to test segmenting """ self.site = SiteFactory(is_default_site=True)
def test_page_factory(): site = SiteFactory() assert site.root_page page = HomePageFactory(parent=site.root_page) assert page.get_parent() == site.root_page
def test_site_factory(): site = SiteFactory() assert site