def test_save_category(self): query = Category(category=v.category2) query.save() query2 = Category.objects.get(category=v.category2) self.assertEqual(query.__str__(), v.category2)
def test_update_category(self): query = Category(id=self.category0.id, category=v.category2) query.save() query2 = Category.objects.get(category=v.category2) self.assertEqual(query2.id, self.category0.id)
def test_save_category_confilict(self): with self.assertRaises(IntegrityError): query = Category(category=self.category0.category) query.save()