mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Used assertRaisesMessage() in various tests.
This commit is contained in:
committed by
Mariusz Felisiak
parent
71756bdfed
commit
fc4f45ebdc
@@ -44,9 +44,8 @@ class MultiValueDictTests(SimpleTestCase):
|
||||
sorted(d.lists()),
|
||||
[('name', ['Adrian', 'Simon']), ('position', ['Developer'])]
|
||||
)
|
||||
with self.assertRaises(MultiValueDictKeyError) as cm:
|
||||
with self.assertRaisesMessage(MultiValueDictKeyError, "'lastname'"):
|
||||
d.__getitem__('lastname')
|
||||
self.assertEqual(str(cm.exception), "'lastname'")
|
||||
self.assertIsNone(d.get('lastname'))
|
||||
self.assertEqual(d.get('lastname', 'nonexistent'), 'nonexistent')
|
||||
self.assertEqual(d.getlist('lastname'), [])
|
||||
|
||||
Reference in New Issue
Block a user