Comments (3)
I see : the client doesn't provide this.
Ok, I'm gona use a make beleive HTTP_HOST that willl be overridable in
the settings in case you can't find that.
Le mar. 13 mai 2014 21:51:51 ICT, Anton Agestam a Γ©crit :
|======================================================================
ERROR: test_gain_access_token (mcr.apps.social_auth.tests.test_grant.TestFacebookAuth)
Traceback (most recent call last):
File "/Users/antonagestam/.virtualenvs/mcr-api/mcr/apps/social_auth/tests/test_grant.py", line 117, in test_gain_access_token
response = self.hit(self.endpoint, data)
File "/Users/antonagestam/.virtualenvs/mcr-api/mcr/apps/social_auth/tests/test_grant.py", line 81, in hit
return self._hit_mocked(_args, *_kwargs)
File "/Users/antonagestam/.virtualenvs/mcr-api/lib/python2.7/site-packages/mock.py", line 1201, in patched
return func(_args, *_keywargs)
File "/Users/antonagestam/.virtualenvs/mcr-api/mcr/apps/social_auth/tests/test_grant.py", line 105, in _hit_mocked
return super(TestFacebookAuth, self)._hit(endpoint, data=data)
File "/Users/antonagestam/.virtualenvs/mcr-api/mcr/apps/social_auth/tests/test_grant.py", line 74, in _hit
return TestClient().post(_args, *_kwargs)
File "/Users/antonagestam/.virtualenvs/mcr-api/src/django/django/test/client.py", line 479, in post
secure=secure, **extra)
File "/Users/antonagestam/.virtualenvs/mcr-api/src/django/django/test/client.py", line 294, in post
secure=secure, **extra)
File "/Users/antonagestam/.virtualenvs/mcr-api/src/django/django/test/client.py", line 355, in generic
return self.request(**r)
File "/Users/antonagestam/.virtualenvs/mcr-api/src/django/django/test/client.py", line 437, in request
six.reraise(*exc_info)
File "/Users/antonagestam/.virtualenvs/mcr-api/src/django/django/core/handlers/base.py", line 89, in get_response
response = middleware_method(request)
File "/Users/antonagestam/.virtualenvs/mcr-api/lib/python2.7/site-packages/django_quicky/middleware.py", line 61, in process_request
prefix = protocol + '://' + request.META['HTTP_HOST']
KeyError: 'HTTP_HOST'
|β
Reply to this email directly or view it on GitHub
#6.
from django-quicky.
@sametmax Yeah, I find it a bit odd that Django's test client doesn't provide HTTP_HOST. I posted a PR for a work-around, not sure if it meets the requirements. I think it should work since with DEBUG=False
you must also provide ALLOWED_HOSTS
.
from django-quicky.
It fixed my problems at least :)
from django-quicky.
Related Issues (6)
- When a form instance is returned from a view, it should return JSON HOT 1
- urls.py HOT 1
- You should be able to force the mime type from the view and an extra context from the view decorator
- When a model instance is returned from a view, it should be serialised as JSON
- namegen syntax error (again) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-quicky.