Exemplo n.º 1
0
    def test_no_tags_url_has_no_query_string(self):
        self._create_activity_log_page()

        page = CFGOVPage(title='test')
        self.root.add_child(instance=page)

        self.assertEqual(RelatedPosts.view_more_url(page, self.request),
                         '/activity-log/')
Exemplo n.º 2
0
    def test_tags_get_appended_as_query_string(self):
        self._create_activity_log_page()

        page = CFGOVPage(title='test')
        self.root.add_child(instance=page)
        page.tags.add('bar')
        page.tags.add('foo')

        self.assertEqual(RelatedPosts.view_more_url(page, self.request),
                         '/activity-log/?topics=bar&topics=foo')
Exemplo n.º 3
0
    def test_no_activity_log_page_raises_does_not_exist(self):
        page = CFGOVPage(title='test')
        self.root.add_child(instance=page)

        with self.assertRaises(Page.DoesNotExist):
            RelatedPosts.view_more_url(page, self.request)