Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22934 closed Bug (fixed)

INSTALLED_APPS must contain django.contrib.sessions for TestCase.client.login to work

Reported by: Chris Jerdonek Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentation says that django.contrib.sessions can be removed from INSTALLED_APPS when using cookie-bases sessions:

https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cookie-based-sessions

However, following this guidance causes TestCase.client.login() to break:

https://github.com/django/django/blob/50b9313e0a0739dfe1ac699449b66ed3e62add51/django/test/client.py#L562

Change History (5)

comment:1 by Tim Graham, 10 years ago

Component: UncategorizedDocumentation
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Yep, has been raised in #20863 and #20915, but should be corrected in the meantime.

comment:2 by Tim Graham <timograham@…>, 10 years ago

In 3a85aae2eacae836e2a92de77615569883b81932:

Revert "Improve cookie based session backend docs." refs #20418

This reverts commit d9c01da1f8ba3d4e0947fd1d619c8f4a9b013360.

This is poor advice as it breaks the test client login (refs #22934).
We can add a note like this back after refs #22986 is resolved.

comment:3 by Tim Graham, 10 years ago

Resolution: fixed
Status: newclosed

I removed the advice of removing django.contrib.sessions from INSTALLED_APPS as a solution to avoid creating the database tables due to the other side effects and filed a new ticket (#22986) for a proper solution.

comment:4 by Tim Graham <timograham@…>, 10 years ago

In a3d710a38f1fab5e092cef7a17826674a00e70ea:

[1.7.x] Revert "Improve cookie based session backend docs." refs #20418

This reverts commit d9c01da1f8ba3d4e0947fd1d619c8f4a9b013360.

This is poor advice as it breaks the test client login (refs #22934).
We can add a note like this back after refs #22986 is resolved.

Backport of 3a85aae2ea from master

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

In f3bdb83ba58a696c0696d8a6706d2c44a00da68a:

[1.6.x] Revert "Improve cookie based session backend docs." refs #20418

This reverts commit d9c01da1f8ba3d4e0947fd1d619c8f4a9b013360.

This is poor advice as it breaks the test client login (refs #22934).
We can add a note like this back after refs #22986 is resolved.

Backport of 3a85aae2ea from master

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