Exemple #1
0
    def test_category_visualization_view_render_template(self):
        category_ = Category()
        category_.name = 'Test category'
        category_.save()

        response = self.client.get('/category_visualizations/%s/' % category_.slug)
        self.assertTemplateUsed(response, 'embedded_visualizations_list.html')
Exemple #2
0
    def test_category_view_page_renders_template(self):
        category_ = Category()
        category_.name = 'Test category'
        category_.save()

        session = self.session
        session['token'] = 'abc123'
        session.save()
        response = self.client.get('/category/%s/' % category_.slug)
        self.assertTemplateUsed(response, 'table.html')
Exemple #3
0
    def test_visualization_view_render_template(self):
        category_ = Category()
        category_.name = 'Test category'
        category_.save()
        embedded_ = EmbeddedVisualization()
        embedded_.category_id = category_.pk
        embedded_.name = 'Visualization Test'
        embedded_.save()

        response = self.client.get('/visualization/%s/' % embedded_.slug)
        self.assertTemplateUsed(response, 'embedded_visualization.html')
 def test_get_absolute_url(self):
     category_ = Category()
     category_.name = 'Test category'
     category_.save()
     self.assertEqual(category_.get_absolute_url(), '/category/%s/' % (category_.slug,))