8
This repository has been archived on 2023-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cavemanon-wagtail-personali…/tests/factories/site.py
Michael van Tellingen 6c5ab9c6ae Merge HomePage/SpecialPage to ContentPage in the tests
No need to create separate models with the same functionality
2017-06-02 09:30:04 +02:00

16 lines
396 B
Python

import factory
from wagtail.wagtailcore.models import Site
from tests.factories.page import ContentPageFactory
class SiteFactory(factory.DjangoModelFactory):
hostname = 'localhost'
port = factory.Sequence(lambda n: 81 + n)
site_name = 'Test site'
root_page = factory.SubFactory(ContentPageFactory, parent=None)
is_default_site = False
class Meta:
model = Site