def test_default_jumbotron(self):
"""
Default jumbotron rendering
"""
page1 = self.create_page(slug='page1', title="Hello", content="<p>test</p>", button1_url='http://example.org/', button1_title="GO")
template = Template('{% load fluent_contents_tags %}{% page_placeholder "content" %}')
request = RequestFactory().get("/", HTTP_HOST='example.org')
html = template.render(Context({'page': page1, 'request': request}))
expected = '''<div class="jumbotron">
<div class="container">
<h1>Hello</h1>
<p>test</p>
<p><a class="btn btn-primary btn-lg" href="http://example.org/" role="button">GO</a></p>
</div>
</div>'''
self.assertEqual(slugify(strip_tags(html)), 'hello-test-go')
self.assertHTMLEqual(html.strip(), expected)
评论列表
文章目录