Git Product home page Git Product logo

Comments (3)

sametmax avatar sametmax commented on June 30, 2024

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.

antonagestam avatar antonagestam commented on June 30, 2024

@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.

antonagestam avatar antonagestam commented on June 30, 2024

It fixed my problems at least :)

from django-quicky.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.