Пример #1
0
 def test_page_summary_multiple_sites(self):
     Site.objects.create(hostname='example.com',
                         root_page=Page.objects.get(pk=1))
     request = self.get_request()
     link = '<a href="{}">'.format(reverse('wagtailadmin_explore_root'))
     page_summary = PagesSummaryItem(request)
     self.assertIn(link, page_summary.render())
Пример #2
0
 def test_page_summary_single_site(self):
     request = self.get_request()
     root_page = request.site.root_page
     link = '<a href="{}">'.format(
         reverse('wagtailadmin_explore', args=[root_page.pk]))
     page_summary = PagesSummaryItem(request)
     self.assertIn(link, page_summary.render())
Пример #3
0
 def test_page_summary_multiple_sites(self):
     Site.objects.create(
         hostname='example.com',
         root_page=Page.objects.get(pk=1))
     request = self.get_request()
     link = '<a href="{}">'.format(reverse('wagtailadmin_explore_root'))
     page_summary = PagesSummaryItem(request)
     self.assertIn(link, page_summary.render())
Пример #4
0
 def test_page_summary_zero_sites(self):
     Site.objects.all().delete()
     request = self.get_request()
     link = '<a href="{}">'.format(reverse('wagtailadmin_explore_root'))
     page_summary = PagesSummaryItem(request)
     self.assertIn(link, page_summary.render())
Пример #5
0
 def test_page_summary_single_site(self):
     request = self.get_request()
     root_page = request.site.root_page
     link = '<a href="{}">'.format(reverse('wagtailadmin_explore', args=[root_page.pk]))
     page_summary = PagesSummaryItem(request)
     self.assertIn(link, page_summary.render())
Пример #6
0
 def test_page_summary_zero_sites(self):
     Site.objects.all().delete()
     request = self.get_request()
     link = '<a href="{}">'.format(reverse('wagtailadmin_explore_root'))
     page_summary = PagesSummaryItem(request)
     self.assertIn(link, page_summary.render())