Ejemplo n.º 1
0
 def test_ensure_views_are_positive(self):
     """
     This should return true for categories where views are not negative.
     """
     cat = Category(name="test", views=-1, likes=0)
     cat.save()
     self.assertEqual((cat.views >= 0), True)
Ejemplo n.º 2
0
 def test_slug_line_creation(self):
     """
     Check that we add appropriate slug to newly created category.
     """
     cat = Category(name="Random Category String")
     cat.save()
     self.assertEqual(cat.slug, "random-category-string")