Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#14939 closed (fixed)

Django's Test Client strips out URL ;-parameters

Reported by: andrewgodwin Owned by: andrewgodwin
Component: Testing framework Version: master
Severity: Keywords: urlparse parameters
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

The parameters I'm referring to are the ones illustrated by this:

scheme://netloc/path;parameters?query#fragment

The test client code uses urlparse[2] to get the path component, while the main URL routing includes them. Thus, if I submit the url /works/23243/;include=artists via a normal HTTP connection, it works fine, but if I submit it via the test client, it gets truncated to /works/23243/.

Ideally, the two should be consistent; I propose doing this by making the test client include the parameter part.

Attachments (1)

ticket-14939-patch.diff (3.0 KB) - added by andrewgodwin 5 years ago.
Initial patch, without tests.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by andrewgodwin

Initial patch, without tests.

comment:1 Changed 5 years ago by andrewgodwin

  • Resolution set to fixed
  • Status changed from new to closed

(In [15027]) Fixed #14939: Don't strip ;-parameters from URLs in the test client.

comment:2 Changed 5 years ago by andrewgodwin

(In [15045]) [1.2.X] Fixed #14939: Don't strip ;-parameters from URLs in the test client.

Backport of [15027] from trunk

Note: See TracTickets for help on using tickets.
Back to Top