def test_update_tag(self): query = Tag(id=self.tag0.id, tag=v.tag2) query.save() query2 = Tag.objects.get(tag=v.tag2) self.assertEqual(query2.id, self.tag0.id)
def test_save_tag(self): query = Tag(tag=v.tag2) query.save() query2 = Tag.objects.get(tag=v.tag2) self.assertEqual(query2.__str__(), v.tag2)
def test_save_tag_confilict(self): with self.assertRaises(IntegrityError): query = Tag(tag=self.tag1.tag) query.save()