Opened 14 years ago

Closed 14 years ago

#14117 closed (invalid)

POST Data is different when run from TestClient and actually received

Reported by: jon@… Owned by: nobody
Component: Testing framework Version: 1.2
Severity: Keywords: TestClient
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In my POST data I have a string that contains a + as a space. (i.e. key=Value+1)

In the test framework, request.POSTkey sees this as 'Value+1', but when run in production request.POSTkey returns 'Value 1'.

So I fixed it in my production environment, but now it causes my tests to fail.

Change History (1)

comment:1 by Paul McMillan, 14 years ago

Resolution: invalid
Status: newclosed

I am unable to duplicate the behavior you're describing.

I think this stems from the fact that different clients are going to interpret + in the string differently - your browser may be converting that a space, for example. Can you doublecheck (e.g. with firebug, look at the post request) to make sure that isn't the effect you're seeing? If you need a specific style of escaping for your application, you may need to escape the string yourself. Also beware of your production server changing these values before they get to your application.

I'm closing this as invalid because I'm pretty sure this is the problem you're seeing, but please re-open it if that isn't the case. When you do, please provide a bit more detailed code to help duplicate the problem you're having, including detailed information about your production setup, and what makes it different from the dev server (which I assume does not have this problem, since you didn't mention it).

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