mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 20:10:10 +03:00
Add request attribute exception test
This commit is contained in:
parent
19f4425cb4
commit
03c581eee3
|
@ -263,3 +263,12 @@ class TestWSGIRequestProxy(TestCase):
|
|||
outer_sentinel = object()
|
||||
request.inner_property = outer_sentinel
|
||||
assert request.inner_property is outer_sentinel
|
||||
|
||||
def test_exception(self):
|
||||
# ensure the exception message is not for the underlying WSGIRequest
|
||||
wsgi_request = factory.get('/')
|
||||
request = Request(wsgi_request)
|
||||
|
||||
message = "'Request' object has no attribute 'inner_property'"
|
||||
with self.assertRaisesMessage(AttributeError, message):
|
||||
request.inner_property
|
||||
|
|
Loading…
Reference in New Issue
Block a user