Example #1
0
 def test_ensure_views_are_positive(self):
     cat = Category(name="nakul", views=-1, likes=0)
     cat.save()
     self.assertEqual((cat.views >= 0), True)
Example #2
0
 def test_slug_line_creation(self):
     cat = Category(name = "Just another category")
     cat.save()
     self.assertEqual(cat.slug, "just-another-category")
Example #3
0
 def test_does_slug_field_work(self):
     from rangoapp.models import Category
     cat = Category(name='how do i create a slug in django')
     cat.save()
     self.assertEqual(cat.slug, 'how-do-i-create-a-slug-in-django')