Opened 7 years ago

Closed 7 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:
Needs tests: Patch needs improvement:
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 7 years ago.
Attached as patch to help formatting

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by adamlofts

Attached as patch to help formatting

comment:1 Changed 7 years ago by russellm

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

(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