mirror of
https://github.com/django/django.git
synced 2025-08-23 20:14:17 +00:00
Used assertRaisesMessage() in various tests.
This commit is contained in:
parent
71756bdfed
commit
fc4f45ebdc
8 changed files with 59 additions and 101 deletions
|
@ -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'), [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue