diff options
| author | Tim Graham <timograham@gmail.com> | 2016-04-14 09:10:33 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-14 09:15:09 -0400 |
| commit | 3cb63b0e473568cb5158d7a4f13cb7e1c9ee89f5 (patch) | |
| tree | d22cdcaef191493225e7b458a44d057317400cb2 /tests | |
| parent | 5c6d397956f405f5c3fee6dc42568386972b9fc2 (diff) | |
Refs #26502 -- Added choices to Form.__getitem__() KeyError message.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/forms_tests/tests/test_forms.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index a8bff32a8c..a5d8fbebdb 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -71,10 +71,9 @@ class FormsTestCase(SimpleTestCase): '<input type="text" name="birthday" value="1940-10-9" id="id_birthday" />' ) - nonexistenterror = "Key u?'nonexistentfield' not found in 'Person'" - with six.assertRaisesRegex(self, KeyError, nonexistenterror): + msg = "Key 'nonexistentfield' not found in 'Person'. Choices are: birthday, first_name, last_name." + with self.assertRaisesMessage(KeyError, msg): p['nonexistentfield'] - self.fail('Attempts to access non-existent fields should fail.') form_output = [] |
