mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-18 12:11:11 +00:00
test that add button is present only if page allows subpages
This commit is contained in:
parent
a5940bef98
commit
805e078556
1 changed files with 5 additions and 5 deletions
|
|
@ -78,18 +78,18 @@ class TestUserbarAddLink(TestCase, WagtailTestUtils):
|
|||
def test_page_allowing_subpages(self):
|
||||
response = self.client.get(reverse('wagtailadmin_userbar_frontend', args=(self.event_index.id, )))
|
||||
|
||||
# page allows subpages, so the 'add page' button should add a subpage
|
||||
# page allows subpages, so the 'add page' button should show
|
||||
expected_url = reverse('wagtailadmin_pages_add_subpage', args=(self.event_index.id, ))
|
||||
expected_link = '<a href="%s" target="_parent" class="action icon icon-plus" title="Add a child page">Add</a>' % expected_url
|
||||
self.assertContains(response, expected_link)
|
||||
|
||||
def test_page_disallowing_subpages(self):
|
||||
response = self.client.get(reverse('wagtailadmin_userbar_frontend', args=(self.business_child.id, )))
|
||||
print response
|
||||
# page disallows subpages, so the 'add page' button should add a page at the same level
|
||||
|
||||
# page disallows subpages, so the 'add page' button shouldn't show
|
||||
expected_url = reverse('wagtailadmin_pages_add_subpage', args=(self.business_index.id, ))
|
||||
expected_link = '<a href="%s" target="_parent" class="action icon icon-plus" title="Add another page at this level">Add</a>' % expected_url
|
||||
self.assertContains(response, expected_link)
|
||||
expected_link = '<a href="%s" target="_parent" class="action icon icon-plus" title="Add a child page">Add</a>' % expected_url
|
||||
self.assertNotContains(response, expected_link)
|
||||
|
||||
|
||||
class TestUserbarModeration(TestCase, WagtailTestUtils):
|
||||
|
|
|
|||
Loading…
Reference in a new issue