python - Django LiveServerTestCase: disable SSL at test-time -
i have cbv "require_ssl" decorator (from this snippet) redirects client same url path under https.
i'm attempting disable ssl @ test-time while liveservertestcase running (since defaults non-secured ).
this needs based on server configuration @ test-time, not http header injected client (since injected in production). can't find flag signify django test server running.
i able solve via @override_setting decorator (present since django 1.4).
my 'require_ssl' decorator can check presence of test-time setting:
getattr(settings, 'under_test', false)
Comments
Post a Comment