当前位置: 首页>>代码示例>>Python>>正文


Python models.EventPageRelatedLink类代码示例

本文整理汇总了Python中wagtail.tests.testapp.models.EventPageRelatedLink的典型用法代码示例。如果您正苦于以下问题:Python EventPageRelatedLink类的具体用法?Python EventPageRelatedLink怎么用?Python EventPageRelatedLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EventPageRelatedLink类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_used_document_get_usage

 def test_used_document_get_usage(self):
     doc = Document.objects.get(id=1)
     page = EventPage.objects.get(id=4)
     event_page_related_link = EventPageRelatedLink()
     event_page_related_link.page = page
     event_page_related_link.link_document = doc
     event_page_related_link.save()
     self.assertTrue(issubclass(Page, type(doc.get_usage()[0])))
开发者ID:davecranwell,项目名称:wagtail,代码行数:8,代码来源:tests.py

示例2: test_used_document_usage_count

 def test_used_document_usage_count(self):
     doc = Document.objects.get(id=1)
     page = EventPage.objects.get(id=4)
     event_page_related_link = EventPageRelatedLink()
     event_page_related_link.page = page
     event_page_related_link.link_document = doc
     event_page_related_link.save()
     self.assertEqual(doc.get_usage().count(), 1)
开发者ID:davecranwell,项目名称:wagtail,代码行数:8,代码来源:tests.py

示例3: test_usage_page

 def test_usage_page(self):
     doc = Document.objects.get(id=1)
     page = EventPage.objects.get(id=4)
     event_page_related_link = EventPageRelatedLink()
     event_page_related_link.page = page
     event_page_related_link.link_document = doc
     event_page_related_link.save()
     response = self.client.get(reverse("wagtaildocs:document_usage", args=(1,)))
     self.assertContains(response, "Christmas")
开发者ID:m1kola,项目名称:wagtail,代码行数:9,代码来源:tests.py

示例4: test_usage_count_appears

 def test_usage_count_appears(self):
     doc = Document.objects.get(id=1)
     page = EventPage.objects.get(id=4)
     event_page_related_link = EventPageRelatedLink()
     event_page_related_link.page = page
     event_page_related_link.link_document = doc
     event_page_related_link.save()
     response = self.client.get(reverse("wagtaildocs:edit", args=(1,)))
     self.assertContains(response, "Used 1 time")
开发者ID:m1kola,项目名称:wagtail,代码行数:9,代码来源:tests.py

示例5: test_usage_count_does_not_appear

 def test_usage_count_does_not_appear(self):
     doc = models.Document.objects.get(id=1)
     page = EventPage.objects.get(id=4)
     event_page_related_link = EventPageRelatedLink()
     event_page_related_link.page = page
     event_page_related_link.link_document = doc
     event_page_related_link.save()
     response = self.client.get(reverse('wagtaildocs:edit',
                                        args=(1,)))
     self.assertNotContains(response, 'Used 1 time')
开发者ID:rkhleics,项目名称:wagtail,代码行数:10,代码来源:test_admin_views.py


注:本文中的wagtail.tests.testapp.models.EventPageRelatedLink类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。