summaryrefslogtreecommitdiffstats
path: root/tests/test_pages.py
diff options
context:
space:
mode:
authorSerghei Mihai <smihai@entrouvert.com>2018-04-19 08:08:51 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2018-04-24 09:49:58 (GMT)
commitbbf8ae107e65526fe1b9150a884eef6a65473554 (patch)
tree3f1422716650220f1fe0d3e5dddb5f618071e696 /tests/test_pages.py
parente0e3ded588094b8f91ffd93540f54acad1209a6b (diff)
downloadcombo-bbf8ae107e65526fe1b9150a884eef6a65473554.zip
combo-bbf8ae107e65526fe1b9150a884eef6a65473554.tar.gz
combo-bbf8ae107e65526fe1b9150a884eef6a65473554.tar.bz2
data: add description to page (#23262)
Diffstat (limited to 'tests/test_pages.py')
-rw-r--r--tests/test_pages.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/test_pages.py b/tests/test_pages.py
index 669d96e..0eb6b3b 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -124,13 +124,13 @@ def test_page_visibility():
assert not page.is_visible(user2)
def test_import_export_pages():
- page = Page(title=u'foo', slug='foo', order=0)
+ page = Page(title=u'foo', slug='foo', order=0, description="Foo's page")
page.save()
cell = TextCell(page=page, text='foo', order=0, placeholder='content')
cell.save()
- page2 = Page(title=u'bar', slug='bar', order=1, parent=page)
+ page2 = Page(title=u'bar', slug='bar', order=1, parent=page, description="Bar's page")
page2.save()
cell = TextCell(page=page2, text='bar', order=0, placeholder='content')
@@ -145,6 +145,8 @@ def test_import_export_pages():
new_page_2 = Page.objects.all().order_by('order')[1]
assert new_page_1.title == 'foo'
assert new_page_2.title == 'bar'
+ assert new_page_1.description == "Foo's page"
+ assert new_page_2.description == "Bar's page"
assert len(CellBase.get_cells(page_id=new_page_1.id)) == 1
assert isinstance(CellBase.get_cells(page_id=new_page_1.id)[0], TextCell)
assert CellBase.get_cells(page_id=new_page_1.id)[0].text == 'foo'
@@ -287,3 +289,10 @@ def test_get_placeholders():
assert set([x.key for x in placeholders]) == set(['content', 'content2', 'sidebar', 'footer'])
footer_placeholder = [x for x in placeholders if x.key == 'footer'][0]
assert footer_placeholder.acquired is False
+
+def test_render(app):
+ page = Page(title=u'foo', slug='foo', template_name='standard-sidebar', order=0, description="page description")
+ page.save()
+ response = app.get(page.get_online_url())
+ assert '<meta name="description" content="page description" />' in response.content
+ assert '<title>Combo - foo</title>' in response.content