本文整理汇总了Python中v1.models.browse_page.BrowsePage.header方法的典型用法代码示例。如果您正苦于以下问题:Python BrowsePage.header方法的具体用法?Python BrowsePage.header怎么用?Python BrowsePage.header使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类v1.models.browse_page.BrowsePage
的用法示例。
在下文中一共展示了BrowsePage.header方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_featured_content
# 需要导入模块: from v1.models.browse_page import BrowsePage [as 别名]
# 或者: from v1.models.browse_page.BrowsePage import header [as 别名]
def test_featured_content(self):
"""Featured content value correctly displays on a Browse Page"""
bp = BrowsePage(
title='Browse Page',
slug='browse-page',
)
bp.header = StreamValue(bp.header.stream_block,
[
atomic.featured_content
], True)
bp.content = StreamValue(bp.content.stream_block,
[
atomic.expandable,
atomic.expandable_group
], True)
publish_page(child=bp)
response = django_client.get('/browse-page/')
self.assertContains(response, 'this is a featured content body')
示例2: run
# 需要导入模块: from v1.models.browse_page import BrowsePage [as 别名]
# 或者: from v1.models.browse_page.BrowsePage import header [as 别名]
#.........这里部分代码省略.........
atomic.half_width_link_blob_group,
atomic.well
], True)
lap.sidefoot = StreamValue(lap.sidefoot.stream_block,
[
atomic.related_links,
atomic.sidebar_contact(contact.id)
], True)
publish_page(lap)
sp = SublandingPage.objects.filter(title='Sublanding Page')
if not sp:
sp = SublandingPage(title='Sublanding Page', slug='sublanding-page', owner=admin_user)
else:
sp = sp[0]
sp.content = StreamValue(sp.content.stream_block,
[
atomic.main_contact_info(contact.id),
atomic.reg_comment
], True)
sp.sidefoot = StreamValue(sp.sidefoot.stream_block,
[
atomic.email_signup,
atomic.rss_feed
], True)
publish_page(sp)
bp = BrowsePage.objects.filter(title='Browse Page')
if not bp:
bp = BrowsePage(title='Browse Page', slug='browse-page', owner=admin_user)
else:
bp = bp[0]
bp.header = StreamValue(bp.header.stream_block,
[
atomic.featured_content
], True)
bp.content = StreamValue(bp.content.stream_block,
[
atomic.expandable,
atomic.expandable_group
], True)
publish_page(bp)
# Filterable Pages
bfp = BrowseFilterablePage.objects.filter(title='Browse Filterable Page')
if not bfp:
bfp = BrowseFilterablePage(title='Browse Filterable Page', slug='browse-filterable-page', owner=admin_user)
else:
bfp = bfp[0]
bfp.header = StreamValue(bfp.header.stream_block, [atomic.text_introduction], True)
publish_page(bfp)
sfp = SublandingFilterablePage.objects.filter(title='Sublanding Filterable Page')
if not sfp:
sfp = SublandingFilterablePage(title='Sublanding Filterable Page', slug='sublanding-filterable-page',
owner=admin_user)
else:
sfp = sfp[0]
sfp.header = StreamValue(sfp.header.stream_block, [atomic.hero], True)
publish_page(sfp)
eap = EventArchivePage.objects.filter(title='Event Archive Page')
if not eap:
eap = EventArchivePage(title='Event Archive Page', slug='event-archive-page', owner=admin_user)
else: