Refactored ValidationError to allow persisting error params and error codes as the exception bubbles up

This commit is contained in:
Loic Bistuer 2013-04-05 02:21:57 +07:00 committed by Tim Graham
parent efe6e16008
commit f34cfec0fa
6 changed files with 67 additions and 55 deletions

View file

@ -213,7 +213,7 @@ class TestSimpleValidators(TestCase):
self.assertEqual(repr(v), str_prefix("ValidationError([%(_)s'First Problem', %(_)s'Second Problem'])"))
def test_message_dict(self):
v = ValidationError({'first': 'First Problem'})
v = ValidationError({'first': ['First Problem']})
self.assertEqual(str(v), str_prefix("{%(_)s'first': %(_)s'First Problem'}"))
self.assertEqual(repr(v), str_prefix("ValidationError({%(_)s'first': %(_)s'First Problem'})"))