Opened 5 years ago

Closed 5 years ago

Last modified 5 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


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 5 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 5 years ago by jMyles

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

comment:1 Changed 5 years ago by PaulM

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

comment:2 Changed 5 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.

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