예제 #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)
예제 #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)
예제 #3
0
 def test_slug(self):
     """Test ComponentList slug."""
     clist = ComponentList()
     clist.slug = "slug"
     self.assertEqual(clist.tab_slug(), "list-slug")
예제 #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()
예제 #5
0
 def test_slug(self):
     """Test ComponentList slug."""
     clist = ComponentList()
     clist.slug = 'slug'
     self.assertEqual(clist.tab_slug(), 'list-slug')