Esempio n. 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)
Esempio n. 2
0
 def test_slug_line_creation(self):
     cat = Category(name = "Just another category")
     cat.save()
     self.assertEqual(cat.slug, "just-another-category")
Esempio n. 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')