mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 20:10:10 +03:00
Rename 'wsgi' request test to more accurate 'http'
This commit is contained in:
parent
73203e6b59
commit
ef2208ccc6
|
@ -271,23 +271,23 @@ class TestSecure(TestCase):
|
||||||
assert request.scheme == 'https'
|
assert request.scheme == 'https'
|
||||||
|
|
||||||
|
|
||||||
class TestWSGIRequestProxy(TestCase):
|
class TestHttpRequest(TestCase):
|
||||||
def test_attribute_access(self):
|
def test_attribute_access_proxy(self):
|
||||||
wsgi_request = factory.get('/')
|
http_request = factory.get('/')
|
||||||
request = Request(wsgi_request)
|
request = Request(http_request)
|
||||||
|
|
||||||
inner_sentinel = object()
|
inner_sentinel = object()
|
||||||
wsgi_request.inner_property = inner_sentinel
|
http_request.inner_property = inner_sentinel
|
||||||
assert request.inner_property is inner_sentinel
|
assert request.inner_property is inner_sentinel
|
||||||
|
|
||||||
outer_sentinel = object()
|
outer_sentinel = object()
|
||||||
request.inner_property = outer_sentinel
|
request.inner_property = outer_sentinel
|
||||||
assert request.inner_property is outer_sentinel
|
assert request.inner_property is outer_sentinel
|
||||||
|
|
||||||
def test_exception(self):
|
def test_exception_proxy(self):
|
||||||
# ensure the exception message is not for the underlying WSGIRequest
|
# ensure the exception message is not for the underlying WSGIRequest
|
||||||
wsgi_request = factory.get('/')
|
http_request = factory.get('/')
|
||||||
request = Request(wsgi_request)
|
request = Request(http_request)
|
||||||
|
|
||||||
message = "'Request' object has no attribute 'inner_property'"
|
message = "'Request' object has no attribute 'inner_property'"
|
||||||
with self.assertRaisesMessage(AttributeError, message):
|
with self.assertRaisesMessage(AttributeError, message):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user