Test error code and message when resource format is unknown

This commit is contained in:
Sajith Sasidharan 2020-08-27 12:54:46 -04:00
parent 5e3eb1fbe5
commit 2c8853b4c6

View File

@ -756,8 +756,10 @@ class MultiFormatResourceTests(TrialTestCase):
returned.
"""
resource = self.resource()
with self.assertRaises(WebError):
with self.assertRaises(WebError) as ex:
self.render(resource, t=["foo"]),
self.assertEquals(ex.exception.text, "Unknown t value: 'foo'")
self.assertEquals(ex.exception.code, 400)
class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixin, TrialTestCase):