mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +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
|
|
@ -79,9 +79,8 @@ class SerializerRegistrationTests(SimpleTestCase):
|
|||
serializers.get_serializer("nonsense")
|
||||
|
||||
# SerializerDoesNotExist is instantiated with the nonexistent format
|
||||
with self.assertRaises(SerializerDoesNotExist) as cm:
|
||||
with self.assertRaisesMessage(SerializerDoesNotExist, 'nonsense'):
|
||||
serializers.get_serializer("nonsense")
|
||||
self.assertEqual(cm.exception.args, ("nonsense",))
|
||||
|
||||
def test_get_unknown_deserializer(self):
|
||||
with self.assertRaises(SerializerDoesNotExist):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue