Opened 8 years ago

Closed 8 years ago

#8636 closed (fixed)

Test runner sets SERVER_PORT to int

Reported by: adamlofts Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The main django wsgi handler sets e.g. SERVER_PORT = '80' but the test runner always sers SERVER_PORT = 80.

Suggested patch:

Index: django/test/client.py
===================================================================
--- django/test/client.py (revision 8649)
+++ django/test/client.py (working copy)
@@ -191,7 +191,7 @@

'REQUEST_METHOD': 'GET',
'SCRIPT_NAME': ,
'SERVER_NAME': 'testserver',

  • 'SERVER_PORT': 80,

+ 'SERVER_PORT': '80',

'SERVER_PROTOCOL': 'HTTP/1.1',

}
environ.update(self.defaults)

Attachments (1)

client.py.patch (507 bytes) - added by adamlofts 8 years ago.
Attached as patch to help formatting

Download all attachments as: .zip

Change History (2)

Changed 8 years ago by adamlofts

Attachment: client.py.patch added

Attached as patch to help formatting

comment:1 Changed 8 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [8655]) Fixed #8636: Corrected the test client to use the string '80' in the request META, rather than the integer 80. Thanks to Adam Lofts for the report and fix.

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