Opened 6 years ago

Closed 6 years ago

#29576 closed Bug (fixed)

HTTP_COOKIE value is wrongly constructed in test client

Reported by: Thng Kai Yuan Owned by: Thng Kai Yuan
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Thng Kai Yuan)

The bug exists at:
https://github.com/django/django/blob/master/django/test/client.py#L280

This existing implementation wrongly constructs cookies into:
' sessionid=helloworld; Domain=None; expires=None; Max-Age=None; Path=/'

For the given example, a fix will correct the construction to be:
'sessionid=helloworld'

Change History (5)

comment:1 by Thng Kai Yuan, 6 years ago

Description: modified (diff)

comment:2 by Thng Kai Yuan, 6 years ago

Summary: Fix construction of HTTP_COOKIE value in base environ of test requestsHTTP_COOKIE value is wrongly constructed in test client

comment:3 by Tim Graham, 6 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham, 6 years ago

Needs tests: unset

Test added in new PR.

comment:5 by Tim Graham <timograham@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 71a739f3:

Fixed #29576 -- Corrected the test client's HTTP_COOKIE header.

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