Fixed issue with choices validation when they are simple list/tuple,

after model.validate() did not get any error message.
Added test to ensure that model.validate() set the correct error
messages.
This commit is contained in:
Martin Alderete
2013-01-15 02:40:15 -03:00
parent 25cdf16cc0
commit f5d02e1b10
3 changed files with 37 additions and 1 deletions

View File

@@ -252,7 +252,7 @@ class BaseField(object):
elif value_to_check not in self.choices:
msg = ('Value must be %s of %s' %
(err_msg, unicode(self.choices)))
self.error()
self.error(msg)
# check validation argument
if self.validation is not None: