本文整理汇总了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])))
示例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)
示例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")
示例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")
示例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')