diff options
author | Brad Walker <brad@bradmwalker.com> | 2014-11-12 16:06:12 -0700 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-11-20 14:31:14 -0500 |
commit | cfa26f29bdd9b0f82211e6f5ff7f4cd63bd66150 (patch) | |
tree | 0068429a9f2e2184ac93921175d6c68e6456b79b /tests/test_exceptions | |
parent | f273cedc76eded138e0418c9db0b425e40797633 (diff) | |
download | django-cfa26f29bdd9b0f82211e6f5ff7f4cd63bd66150.tar.gz |
Reduced reduce() usage; refs #23796.
django.core.exceptions.ValidationError.messages() and
django.db.backends.schema.BaseDatabaseSchemaEditor._alter_field():
Replaced reduce(operator.add, ...) w/uncoupled, explicit sum()
Diffstat (limited to 'tests/test_exceptions')
-rw-r--r-- | tests/test_exceptions/test_validation_error.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_exceptions/test_validation_error.py b/tests/test_exceptions/test_validation_error.py index ee91fc75b4..a0bbfaf77e 100644 --- a/tests/test_exceptions/test_validation_error.py +++ b/tests/test_exceptions/test_validation_error.py @@ -6,8 +6,8 @@ from django.core.exceptions import ValidationError class TestValidationError(unittest.TestCase): def test_messages_concatenates_error_dict_values(self): message_dict = {} - with self.assertRaises(TypeError): - ValidationError(message_dict).messages + exception = ValidationError(message_dict) + self.assertEqual(sorted(exception.messages), []) message_dict['field1'] = ['E1', 'E2'] exception = ValidationError(message_dict) self.assertEqual(sorted(exception.messages), ['E1', 'E2']) |