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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -