mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-25 19:14:01 +03:00
test_quests: added TestSecure for the emulation of secure connections in test cases
This commit is contained in:
parent
8c5fc2a94b
commit
d86e494e86
|
@ -275,3 +275,14 @@ class TestAuthSetter(TestCase):
|
|||
request = Request(factory.get('/'))
|
||||
request.auth = 'DUMMY'
|
||||
self.assertEqual(request.auth, 'DUMMY')
|
||||
|
||||
|
||||
class TestSecure(TestCase):
|
||||
|
||||
def test_default_secure_false(self):
|
||||
request = Request(factory.get('/', secure=False))
|
||||
self.assertEqual(request.scheme, 'http')
|
||||
|
||||
def test_default_secure_true(self):
|
||||
request = Request(factory.get('/', secure=True))
|
||||
self.assertEqual(request.scheme, 'https')
|
||||
|
|
Loading…
Reference in New Issue
Block a user