Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a test for #985

  • Loading branch information...
commit 73941bbf267df77f10bfe558a61cea2396024139 1 parent 4d6e1b0
@ojii ojii authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 cms/tests/page.py
View
24 cms/tests/page.py
@@ -532,3 +532,27 @@ def test_get_page_from_request_fakeadmin_nopage(self):
request = self.get_request('/admin/')
page = get_page_from_request(request)
self.assertEqual(page, None)
+
+class PreviousFilteredSiblingsTests(CMSTestCase):
+ def test_with_publisher(self):
+ home = create_page('home', 'nav_playground.html', 'en', published=True)
+ home.publish()
+ other = create_page('other', 'nav_playground.html', 'en', published=True)
+ other.publish()
+ other = Page.objects.get(pk=other.pk)
+ home = Page.objects.get(pk=home.pk)
+ self.assertEqual(other.get_previous_filtered_sibling(), home)
+ self.assertEqual(home.get_previous_filtered_sibling(), None)
+
+ def test_multisite(self):
+ firstsite = Site.objects.create(name='first', domain='first.com')
+ secondsite = Site.objects.create(name='second', domain='second.com')
+ home = create_page('home', 'nav_playground.html', 'en', published=True, site=firstsite)
+ home.publish()
+ other = create_page('other', 'nav_playground.html', 'en', published=True, site=secondsite)
+ other.publish()
+ other = Page.objects.get(pk=other.pk)
+ home = Page.objects.get(pk=home.pk)
+ self.assertEqual(other.get_previous_filtered_sibling(), None)
+ self.assertEqual(home.get_previous_filtered_sibling(), None)
+
Please sign in to comment.
Something went wrong with that request. Please try again.