7
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/conftest.py
Michael van Tellingen 7436384471 Move visit count logic to the segment adapter
This makes the code also a bit simpler and updates the tests
2017-05-31 13:57:19 +02:00

22 lines
702 B
Python

from __future__ import absolute_import, unicode_literals
import pytest
from wagtail.wagtailcore.models import Page, Site
from wagtail_factories import SiteFactory
from tests.factories.page import PageFactory
@pytest.fixture(scope='session')
def django_db_setup(django_db_setup, django_db_blocker):
with django_db_blocker.unblock():
# Remove some initial data that is brought by the sandbox module
Site.objects.all().delete()
Page.objects.all().exclude(depth=1).delete()
@pytest.fixture(scope='function')
def site():
site = SiteFactory(is_default_site=True)
PageFactory(parent=site.root_page, slug='page-1')
PageFactory(parent=site.root_page, slug='page-2')