0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00

Fix broken test creating page with streamfield

This commit is contained in:
ludolf_takens 2016-06-17 15:23:48 +02:00 committed by Matt Westcott
parent 980cc07ef0
commit 19e3017de0
2 changed files with 15 additions and 5 deletions

View File

@ -528,6 +528,10 @@ class StreamPage(Page):
api_fields = ('body',)
content_panels = [
FieldPanel('title'),
StreamFieldPanel('body'),
]
class MTIBasePage(Page):
is_creatable = False

View File

@ -46,11 +46,17 @@ class TestWagtailPageTests(WagtailPageTests):
self.assertTrue(EventIndex.objects.exists())
self.assertCanCreate(self.root, StreamPage, {
'title': 'WebDev42',
'body': json.dumps([
{'type': 'text', 'value': 'Some text'},
{'type': 'rich_text', 'value': '<p>Some rich text</p>'},
])})
'title': 'Flierp',
'body-0-type': 'text',
'body-0-value': 'Dit is onze mooie text',
'body-0-order': '0',
'body-0-deleted': '',
'body-1-type': 'rich_text',
'body-1-value': '<p>Dit is onze mooie text in een ferrari</p>',
'body-1-order': '1',
'body-1-deleted': '',
'body-count': '2'
})
def test_assert_can_create_subpage_rules(self):
simple_page = SimplePage(title='Simple Page', slug='simple', content="hello")