summaryrefslogtreecommitdiffstats
path: root/tests/test_pages.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_pages.py')
-rw-r--r--tests/test_pages.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_pages.py b/tests/test_pages.py
index f44ee17..5f45670 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -197,6 +197,7 @@ def test_duplicate_page():
group1 = Group.objects.create(name='foobar')
group2 = Group.objects.create(name='fooblah')
+ Page.objects.create() # page without snapshot, with slug 'index'
page = Page.objects.create(
title='foo',
slug='foo',
@@ -213,7 +214,7 @@ def test_duplicate_page():
new_page = page.duplicate()
assert new_page.pk != page.pk
assert new_page.title == 'Copy of foo'
- assert new_page.slug == page.slug
+ assert new_page.slug == 'copy-of-foo'
assert new_page.description == page.description
assert new_page.parent is None
assert new_page.snapshot is None
@@ -231,6 +232,10 @@ def test_duplicate_page():
assert new_cell2.placeholder == cell2.placeholder
assert list(new_cell2.groups.all()) == []
+ # duplicate again !
+ new_page = page.duplicate()
+ assert new_page.slug == 'copy-of-foo-2'
+
parent = Page.objects.create()
page.parent = parent
page.save()