mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-04 21:44:44 +00:00
add failing tests for has_published_changes flag on go-live / expiry
This commit is contained in:
parent
25cbbb4778
commit
9176c8f647
1 changed files with 4 additions and 0 deletions
|
|
@ -118,6 +118,7 @@ class TestPublishScheduledPagesCommand(TestCase):
|
|||
title="Hello world!",
|
||||
slug="hello-world",
|
||||
live=False,
|
||||
has_unpublished_changes=True,
|
||||
go_live_at=timezone.now() - timedelta(days=1),
|
||||
)
|
||||
self.root_page.add_child(instance=page)
|
||||
|
|
@ -132,6 +133,7 @@ class TestPublishScheduledPagesCommand(TestCase):
|
|||
|
||||
p = Page.objects.get(slug='hello-world')
|
||||
self.assertTrue(p.live)
|
||||
self.assertFalse(p.has_unpublished_changes)
|
||||
self.assertFalse(PageRevision.objects.filter(page=p).exclude(approved_go_live_at__isnull=True).exists())
|
||||
|
||||
# Check that the page_published signal was fired
|
||||
|
|
@ -174,6 +176,7 @@ class TestPublishScheduledPagesCommand(TestCase):
|
|||
title="Hello world!",
|
||||
slug="hello-world",
|
||||
live=True,
|
||||
has_unpublished_changes=False,
|
||||
expire_at=timezone.now() - timedelta(days=1),
|
||||
)
|
||||
self.root_page.add_child(instance=page)
|
||||
|
|
@ -185,6 +188,7 @@ class TestPublishScheduledPagesCommand(TestCase):
|
|||
|
||||
p = Page.objects.get(slug='hello-world')
|
||||
self.assertFalse(p.live)
|
||||
self.assertTrue(p.has_unpublished_changes)
|
||||
self.assertTrue(p.expired)
|
||||
|
||||
# Check that the page_published signal was fired
|
||||
|
|
|
|||
Loading…
Reference in a new issue