def test_validate_raise_false(self): instance = ZoopObjectFactory(id=1) self.assertIsInstance(instance, ZoopObject) instance.id = None instance.validate_fields(raise_exception=False)
def test_validate_raise(self): instance = ZoopObjectFactory(id=1) self.assertIsInstance(instance, ZoopObject) instance.id = None self.assertRaises(ValidationError, instance.validate_fields)