diff --git a/django/core/exceptions.py b/django/core/exceptions.py
index 87b173b..bbb79cb 100644
a
|
b
|
class ValidationError(Exception):
|
112 | 112 | self.code = code |
113 | 113 | self.params = params |
114 | 114 | self.error_list = [self] |
| 115 | |
| 116 | super(ValidationError, self).__init__(None) |
115 | 117 | |
116 | 118 | @property |
117 | 119 | def message_dict(self): |
diff --git a/tests/validation/test_picklable.py b/tests/validation/test_picklable.py
new file mode 100644
index 0000000..b494bf9
-
|
+
|
|
| 1 | from django.core.exceptions import ValidationError |
| 2 | from django.test import TestCase |
| 3 | import pickle |
| 4 | |
| 5 | class PickableValidationErrorTestCase(TestCase): |
| 6 | |
| 7 | def test_validationerror_is_picklable(self): |
| 8 | expected = ValidationError(['a', 'b']) |
| 9 | actual = pickle.loads(pickle.dumps(expected)) |
| 10 | |
| 11 | self.assertEqual(actual.error_list[0].message, expected.error_list[0].message) |
| 12 | self.assertEqual(actual.error_list[1].message, expected.error_list[1].message) |