{{{
from django.test import Client
client = Client()
client.get('/', {'wsgi.url_scheme': 'https'})
}}}
This is quite obscure and undocumented, something like ``client.get('/',
secure=True)`` would be far cleaner. The way ``django.test.client.Client``
and ``django.test.client.RequestFactory`` are build, we would need to
modify each request method in both of them.
--
Ticket URL: <https://code.djangoproject.com/ticket/21341>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:1>
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:2>
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:3>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:4>
* has_patch: 0 => 1
Comment:
PR sent: https://github.com/django/django/pull/1820
All the request methods of django.test.client.Client receive a secure
argument that defaults to False indicating wether or not to make the
request through https.
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:5>
Comment (by unaizalakain):
This would make #13725 easier too.
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:6>
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:7>
* stage: Accepted => Ready for checkin
Comment:
This looks pretty good to me. I left a few comments on the pull request.
I'm marking as RFC anyway because these comments are minor and could be
made by the committer.
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:8>
Comment (by unaizalakain):
Thanks for the review, suggestions applied!
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In: 99b681e227b5b7880d6edd0d8dd670034d431859
Fixed #21341 -- Eased https requests with the test client
--
Ticket URL: <https://code.djangoproject.com/ticket/21341#comment:10>