Ejemplo n.º 1
0
 def test_get_category_with_name(self):
     category1 = Category.get_category_with_name(name='Category_1')
     category2 = Category.get_category_with_name(name='Category_2')
     category3 = Category.get_category_with_name(name='Category3')
     category4 = Category.get_category_with_name(name='Category_4')
     self.assertEqual(category1.name, 'Category 1')
     self.assertEqual(category2.name, 'Category_2')
     self.assertEqual(category3.name, 'Category3')
     self.assertEqual(category4.name, 'Category#4')
Ejemplo n.º 2
0
 def test_get_category_with_name_when_invalid(self):
     with self.assertRaises(Http404):
         Category.get_category_with_name('Category with whitespace invalid')