7

Add unittest for serving a regular page

See #150
This commit is contained in:
Michael van Tellingen
2017-06-02 10:32:41 +02:00
parent 5aa754dd80
commit 559d3c5356
4 changed files with 34 additions and 7 deletions

View File

@ -2,14 +2,22 @@ from __future__ import absolute_import, unicode_literals
import factory
from django.utils.text import slugify
from wagtail_factories.factories import MP_NodeFactory
from wagtail_factories.factories import PageFactory
from tests.site.pages.models import ContentPage
from tests.site.pages import models
class ContentPageFactory(MP_NodeFactory):
class ContentPageFactory(PageFactory):
title = 'Test page'
slug = factory.LazyAttribute(lambda obj: slugify(obj.title))
class Meta:
model = ContentPage
model = models.ContentPage
class RegularPageFactory(PageFactory):
title = 'Regular page'
slug = factory.LazyAttribute(lambda obj: slugify(obj.title))
class Meta:
model = models.RegularPage