mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 05:20:12 +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):
|
def test_default_secure_true(self):
|
||||||
request = Request(factory.get('/', secure=True))
|
request = Request(factory.get('/', secure=True))
|
||||||
assert request.scheme == 'https'
|
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