Skip to content

Commit

Permalink
add failing test for wagtail#557
Browse files Browse the repository at this point in the history
  • Loading branch information
gasman committed Oct 1, 2014
1 parent 21d3809 commit 2c01c27
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wagtail/wagtailcore/tests/test_page_queryset.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,19 @@ def test_type(self):
event = Page.objects.get(url_path='/home/events/someone-elses-event/')
self.assertTrue(pages.filter(id=event.id).exists())

def test_type_includes_subclasses(self):
from wagtail.wagtailforms.models import AbstractEmailForm
pages = Page.objects.type(AbstractEmailForm)

# Check that all objects are instances of AbstractEmailForm
for page in pages:
self.assertIsInstance(page.specific, AbstractEmailForm)

# Check that the contact form page is in the results
contact_us = Page.objects.get(url_path='/home/contact-us/')
self.assertTrue(pages.filter(id=contact_us.id).exists())


def test_not_type(self):
pages = Page.objects.not_type(EventPage)

Expand Down

0 comments on commit 2c01c27

Please sign in to comment.