kopia lustrzana https://github.com/wagtail/wagtail
Remove slug assignment from a bunch of tests that no longer need it
rodzic
0c4cab8705
commit
57f5126f90
|
@ -9,7 +9,7 @@ from wagtail.wagtailcore.models import Page, Site
|
|||
class TemplateTestCase(TestCase, WagtailTestUtils):
|
||||
def setUp(self):
|
||||
root = Page.objects.first()
|
||||
other_home = Page(title='Other Root', slug='other')
|
||||
other_home = Page(title='Other Root')
|
||||
root.add_child(instance=other_home)
|
||||
|
||||
self.default_site = Site.objects.get(is_default_site=True)
|
||||
|
|
|
@ -652,7 +652,6 @@ class TestPageDetailWithStreamField(TestCase):
|
|||
def make_stream_page(self, body):
|
||||
stream_page = StreamPage(
|
||||
title='stream page',
|
||||
slug='stream-page',
|
||||
body=body
|
||||
)
|
||||
return self.homepage.add_child(instance=stream_page)
|
||||
|
|
|
@ -118,7 +118,7 @@ class TestCachePurging(TestCase):
|
|||
def test_purge_with_unroutable_page(self):
|
||||
PURGED_URLS[:] = [] # reset PURGED_URLS to the empty list
|
||||
root = Page.objects.get(url_path='/')
|
||||
page = EventIndex(title='new top-level page', slug='new-top-level-page')
|
||||
page = EventIndex(title='new top-level page')
|
||||
root.add_child(instance=page)
|
||||
page.save_revision().publish()
|
||||
self.assertEqual(PURGED_URLS, [])
|
||||
|
|
|
@ -13,7 +13,6 @@ class TestRoutablePage(TestCase):
|
|||
self.home_page = Page.objects.get(id=2)
|
||||
self.routable_page = self.home_page.add_child(instance=self.model(
|
||||
title="Routable Page",
|
||||
slug='routable-page',
|
||||
live=True,
|
||||
))
|
||||
|
||||
|
@ -117,7 +116,6 @@ class TestRoutablePageTemplateTag(TestCase):
|
|||
self.home_page = Page.objects.get(id=2)
|
||||
self.routable_page = self.home_page.add_child(instance=RoutablePageTest(
|
||||
title="Routable Page",
|
||||
slug='routable-page',
|
||||
live=True,
|
||||
))
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ class TestChooserBrowse(TestCase, WagtailTestUtils):
|
|||
self.root_page = Page.objects.get(id=2)
|
||||
|
||||
# Add child page
|
||||
self.child_page = SimplePage(title="foobarbaz", slug="foobarbaz", content="hello")
|
||||
self.child_page = SimplePage(title="foobarbaz", content="hello")
|
||||
self.root_page.add_child(instance=self.child_page)
|
||||
|
||||
self.login()
|
||||
|
@ -46,7 +46,7 @@ class TestChooserBrowseChild(TestCase, WagtailTestUtils):
|
|||
self.root_page = Page.objects.get(id=2)
|
||||
|
||||
# Add child page
|
||||
self.child_page = SimplePage(title="foobarbaz", slug="foobarbaz", content="hello")
|
||||
self.child_page = SimplePage(title="foobarbaz", content="hello")
|
||||
self.root_page.add_child(instance=self.child_page)
|
||||
|
||||
self.login()
|
||||
|
@ -71,7 +71,6 @@ class TestChooserBrowseChild(TestCase, WagtailTestUtils):
|
|||
# Add a page that is not a SimplePage
|
||||
event_page = EventPage(
|
||||
title="event",
|
||||
slug="event",
|
||||
location='the moon', audience='public',
|
||||
cost='free', date_from='2001-01-01',
|
||||
)
|
||||
|
@ -80,12 +79,10 @@ class TestChooserBrowseChild(TestCase, WagtailTestUtils):
|
|||
# Add a page with a child page
|
||||
event_index_page = EventIndex(
|
||||
title="events",
|
||||
slug="events",
|
||||
)
|
||||
self.root_page.add_child(instance=event_index_page)
|
||||
event_index_page.add_child(instance=EventPage(
|
||||
title="other event",
|
||||
slug="other-event",
|
||||
location='the moon', audience='public',
|
||||
cost='free', date_from='2001-01-01',
|
||||
))
|
||||
|
@ -128,7 +125,6 @@ class TestChooserBrowseChild(TestCase, WagtailTestUtils):
|
|||
# Add a page that is not a SimplePage
|
||||
event_page = EventPage(
|
||||
title="event",
|
||||
slug="event",
|
||||
location='the moon', audience='public',
|
||||
cost='free', date_from='2001-01-01',
|
||||
)
|
||||
|
@ -206,7 +202,7 @@ class TestChooserSearch(TestCase, WagtailTestUtils):
|
|||
self.root_page = Page.objects.get(id=2)
|
||||
|
||||
# Add child page
|
||||
self.child_page = SimplePage(title="foobarbaz", slug="foobarbaz", content="hello")
|
||||
self.child_page = SimplePage(title="foobarbaz", content="hello")
|
||||
self.root_page.add_child(instance=self.child_page)
|
||||
|
||||
self.login()
|
||||
|
@ -230,7 +226,6 @@ class TestChooserSearch(TestCase, WagtailTestUtils):
|
|||
# Add a page that is not a SimplePage
|
||||
event_page = EventPage(
|
||||
title="foo",
|
||||
slug="foo",
|
||||
location='the moon', audience='public',
|
||||
cost='free', date_from='2001-01-01',
|
||||
)
|
||||
|
@ -265,7 +260,6 @@ class TestChooserSearch(TestCase, WagtailTestUtils):
|
|||
# Add a page that is not a SimplePage
|
||||
event_page = EventPage(
|
||||
title="foo",
|
||||
slug="foo",
|
||||
location='the moon', audience='public',
|
||||
cost='free', date_from='2001-01-01',
|
||||
)
|
||||
|
|
|
@ -15,14 +15,12 @@ class TestSetPrivacyView(TestCase, WagtailTestUtils):
|
|||
|
||||
self.public_page = self.homepage.add_child(instance=SimplePage(
|
||||
title="Public page",
|
||||
slug='public-page',
|
||||
content="hello",
|
||||
live=True,
|
||||
))
|
||||
|
||||
self.private_page = self.homepage.add_child(instance=SimplePage(
|
||||
title="Private page",
|
||||
slug='private-page',
|
||||
content="hello",
|
||||
live=True,
|
||||
))
|
||||
|
@ -30,7 +28,6 @@ class TestSetPrivacyView(TestCase, WagtailTestUtils):
|
|||
|
||||
self.private_child_page = self.private_page.add_child(instance=SimplePage(
|
||||
title="Private child page",
|
||||
slug='private-child-page',
|
||||
content="hello",
|
||||
live=True,
|
||||
))
|
||||
|
@ -140,14 +137,12 @@ class TestPrivacyIndicators(TestCase, WagtailTestUtils):
|
|||
|
||||
self.public_page = self.homepage.add_child(instance=SimplePage(
|
||||
title="Public page",
|
||||
slug='public-page',
|
||||
content="hello",
|
||||
live=True,
|
||||
))
|
||||
|
||||
self.private_page = self.homepage.add_child(instance=SimplePage(
|
||||
title="Private page",
|
||||
slug='private-page',
|
||||
content="hello",
|
||||
live=True,
|
||||
))
|
||||
|
@ -155,7 +150,6 @@ class TestPrivacyIndicators(TestCase, WagtailTestUtils):
|
|||
|
||||
self.private_child_page = self.private_page.add_child(instance=SimplePage(
|
||||
title="Private child page",
|
||||
slug='private-child-page',
|
||||
content="hello",
|
||||
live=True,
|
||||
))
|
||||
|
|
|
@ -85,10 +85,10 @@ class TestUserbarAddLink(TestCase, WagtailTestUtils):
|
|||
self.homepage = Page.objects.get(url_path='/home/')
|
||||
self.event_index = Page.objects.get(url_path='/home/events/')
|
||||
|
||||
self.business_index = BusinessIndex(title='Business', slug='business', live=True)
|
||||
self.business_index = BusinessIndex(title='Business', live=True)
|
||||
self.homepage.add_child(instance=self.business_index)
|
||||
|
||||
self.business_child = BusinessChild(title='Business Child', slug='child', live=True)
|
||||
self.business_child = BusinessChild(title='Business Child', live=True)
|
||||
self.business_index.add_child(instance=self.business_child)
|
||||
|
||||
def test_page_allowing_subpages(self):
|
||||
|
|
|
@ -14,7 +14,6 @@ class TestAdminPageChooserWidget(TestCase):
|
|||
# Add child page
|
||||
self.child_page = SimplePage(
|
||||
title="foobarbaz",
|
||||
slug="foobarbaz",
|
||||
content="hello",
|
||||
)
|
||||
self.root_page.add_child(instance=self.child_page)
|
||||
|
|
Ładowanie…
Reference in New Issue