Esempio n. 1
0
 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])))
Esempio n. 2
0
 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)
Esempio n. 3
0
 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")
Esempio n. 4
0
 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")
Esempio n. 5
0
 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')
 def test_used_report_get_usage(self):
     report = models.Report.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_report = doc
     event_page_related_link.save()
     self.assertTrue(issubclass(Page, type(report.get_usage()[0])))
 def test_used_report_usage_count(self):
     report = models.Report.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_report = doc
     event_page_related_link.save()
     self.assertEqual(report.get_usage().count(), 1)
Esempio n. 8
0
 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])))
Esempio n. 9
0
 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)
 def test_usage_count_appears(self):
     report = models.Report.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_report = doc
     event_page_related_link.save()
     response = self.client.get(reverse('wagtailreports:edit', args=(1, )))
     self.assertContains(response, 'Used 1 time')
Esempio n. 11
0
 def test_usage_count_does_not_appear(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.assertNotContains(response, 'Used 1 time')
 def test_usage_page(self):
     report = models.Report.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_report = doc
     event_page_related_link.save()
     response = self.client.get(
         reverse('wagtailreports:report_usage', args=(1, )))
     self.assertContains(response, 'Christmas')