test_quests: added TestSecure for the emulation of secure connections in test cases

This commit is contained in:
Markus Korn 2015-06-22 14:04:46 +02:00
parent 8c5fc2a94b
commit d86e494e86

View File

@ -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')