Cleaned up exception message checking in some tests.

This commit is contained in:
Jon Dufresne 2019-03-15 16:27:57 -07:00 committed by Tim Graham
parent 58ad030d05
commit 95b7699ffc
6 changed files with 15 additions and 9 deletions

View file

@ -829,8 +829,9 @@ class ClientTest(TestCase):
def test_response_raises_multi_arg_exception(self):
"""A request may raise an exception with more than one required arg."""
with self.assertRaises(TwoArgException):
with self.assertRaises(TwoArgException) as cm:
self.client.get('/two_arg_exception/')
self.assertEqual(cm.exception.args, ('one', 'two'))
def test_uploading_temp_file(self):
with tempfile.TemporaryFile() as test_file: