#27760: Hard to diagnose reason for 400 response when making test request that
sets
SERVER_NAME
-------------------------------------+-------------------------------------
Reporter: Peter Inglesby | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Testing framework | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Someday/Maybe
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Petr DlouhĂ˝):
To anyone bumping into this. I was able to determine the cause of the Bad
request by adding
{{{
@override_settings(
DEBUG=True,
)
}}}
decorator to the test class and then printing the response into file with
{{{
with open("response.html", "w") as f:
f.write(response.content.decode())
}}}
And the error was, that I hadn't test server url in `ALOWED_HOSTS`.
--
Ticket URL: <https://code.djangoproject.com/ticket/27760#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.623b96330d3b254665ba2a974efba04a%40djangoproject.com.