From a00b640090d7030cfb2a2764fc8e32b24145b962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Mon, 20 Jan 2020 14:11:45 +0100 Subject: [PATCH] misc: add foldable cell and list of links to style demo page (#39112) --- combo/public/views.py | 13 +++++++++++++ tests/test_public.py | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/combo/public/views.py b/combo/public/views.py index a2303488..4ffc6e1d 100644 --- a/combo/public/views.py +++ b/combo/public/views.py @@ -343,6 +343,9 @@ class StyleDemoPage(object): cell.text = '

%s

%s' % ( lorem_ipsum.words(3, common=False), '\n'.join(['

%s

' % x for x in lorem_ipsum.paragraphs(3)])) + if i == 1: + cell.extra_css_class = 'foldable' + cell.save() cell.save() if i == 0: @@ -365,6 +368,16 @@ class StyleDemoPage(object): _('Select')) cell.save() + if i == 1: + # add a list of links in second placeholder + cell = TextCell(page=self.page, placeholder=placeholder.key, order=1) + cell.text = '

%s

' + cell.save() + return self.page def __exit__(self, type, value, traceback): diff --git a/tests/test_public.py b/tests/test_public.py index 14d9a4f7..dc19fd07 100644 --- a/tests/test_public.py +++ b/tests/test_public.py @@ -444,6 +444,11 @@ def test_style_demo(app, admin_user): assert TextCell.objects.count() == 0 assert Page.objects.count() == 0 + resp = app.get('/__style__/?template=standard-sidebar', status=200) + assert 'links-list' in resp.text + assert Page.objects.count() == 0 + + def test_page_async_cell(app): Page.objects.all().delete() page = Page(title='Home', slug='index', template_name='standard')