Esempio n. 1
0
    def test_component_list(self):
        clist = ComponentList(name="TestCL", slug="testcl")
        clist.save()

        response = self.client.get(reverse("home"))
        self.assertContains(response, "TestCL")
        self.assertEqual(len(response.context["componentlists"]), 1)
Esempio n. 2
0
    def test_component_list(self):
        clist = ComponentList(name="TestCL", slug="testcl")
        clist.save()

        response = self.client.get(reverse('home'))
        self.assertContains(response, 'TestCL')
        self.assertEqual(len(response.context['componentlists']), 1)
Esempio n. 3
0
 def test_slug(self):
     """Test ComponentList slug."""
     clist = ComponentList()
     clist.slug = "slug"
     self.assertEqual(clist.tab_slug(), "list-slug")
Esempio n. 4
0
    def test_can_be_imported(self):
        """Test that ComponentList model can be imported.

        Rather dumb test just to make sure there are no obvious parsing errors.
        """
        ComponentList()
Esempio n. 5
0
 def test_slug(self):
     """Test ComponentList slug."""
     clist = ComponentList()
     clist.slug = 'slug'
     self.assertEqual(clist.tab_slug(), 'list-slug')