mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-03 20:10:10 +03:00
Add tests for proxying WSGIRequest attributes in Request.
This commit is contained in:
parent
a3df1c1199
commit
19f4425cb4
|
@ -249,3 +249,17 @@ class TestSecure(TestCase):
|
|||
def test_default_secure_true(self):
|
||||
request = Request(factory.get('/', secure=True))
|
||||
assert request.scheme == 'https'
|
||||
|
||||
|
||||
class TestWSGIRequestProxy(TestCase):
|
||||
def test_attribute_access(self):
|
||||
wsgi_request = factory.get('/')
|
||||
request = Request(wsgi_request)
|
||||
|
||||
inner_sentinel = object()
|
||||
wsgi_request.inner_property = inner_sentinel
|
||||
assert request.inner_property is inner_sentinel
|
||||
|
||||
outer_sentinel = object()
|
||||
request.inner_property = outer_sentinel
|
||||
assert request.inner_property is outer_sentinel
|
||||
|
|
Loading…
Reference in New Issue
Block a user