From cfa26f29bdd9b0f82211e6f5ff7f4cd63bd66150 Mon Sep 17 00:00:00 2001 From: Brad Walker Date: Wed, 12 Nov 2014 16:06:12 -0700 Subject: 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() --- tests/test_exceptions/test_validation_error.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_exceptions/test_validation_error.py') 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']) -- cgit v1.3