Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#16987 closed Bug (fixed)

Improve failure message for test_invalid_session_key

Reported by: justin@… Owned by: jMyles
Component: contrib.sessions Version: 1.3
Severity: Normal Keywords: tests, sessions
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

contrib.sessions.tests.SessionTestsMixin.test_invalid_key raises AttributeError if middleware has written an item to the cache which uses an integer for the key.

Ticket author found that djangobb (a packaged django forum app which ticket author has no affiliation) uses this technique.

Conventional session cache keys, for security as well as readability, need to use namespaces.

Attachments (1)

better_invalid_session_key_testfail (674 bytes) - added by jMyles 3 years ago.
Patch developed at DiscSpace - this patch would have saved half a day's work.

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by jMyles

Patch developed at DiscSpace - this patch would have saved half a day's work.

comment:1 Changed 3 years ago by PaulM

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by PaulM

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

In [16926]:

Fixed #16987 -- Improved error message for session tests. Thanks jMyles and DiskSpace for the patch.

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.