Code

Opened 4 years ago

Closed 4 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: UI/UX:

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.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by PaulM

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.