def test_with_validators(self):
field = encrypt(
models.IntegerField(validators=[validators.MinValueValidator(1)]))
field.clean(1, None)
with self.assertRaises(exceptions.ValidationError) as cm:
field.clean(0, None)
self.assertEqual('Ensure this value is greater than or equal to 1.',
cm.exception.messages[0])
test_encrypted.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录