#12720 closed (fixed)
Django test client cookie handling broken with Python trunk and next 2.6.$NEXT
Reported by: | James Henstridge | Owned by: | nobody |
---|---|---|---|
Component: | Testing framework | Version: | 1.1 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
After upgrading to the the Ubuntu 10.04 alpha, I found that the tests for my Django application started failing. This seemed to be because the Python 2.6 package included unreleased fixes from the release26-maint branch. In particular it included the following bug fix to the Cookie module:
When the django.test client builds up a WSGI environment, it passes a SimpleCookie instance for HTTP_COOKIE. Prior to the change, django.http.parse_cookie() would copy the morsels directly. After the change, the values for all the cookies are the str() version of the morsels (e.g. "Set-Cookie: sessionid=value" instead of "value").
This breaks any tests that depend on cookie handling (e.g. those that depend on cookie authentication).
While this does represent a change of behaviour in Python, the behaviour of the django test client does not really match the WSGI specification in this regard, so I think it'd be worth fixing in Django. Patch attached.
Attachments (1)
Change History (3)
by , 15 years ago
Attachment: | django-test-client-cookie-fix.patch added |
---|
comment:1 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
django-test-client-cookie-fix.patch