mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Used assertRaisesMessage() in various tests.
This commit is contained in:
committed by
Mariusz Felisiak
parent
71756bdfed
commit
fc4f45ebdc
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user