Opened 11 years ago

Closed 11 years ago

#21331 closed Uncategorized (duplicate)

Could not login user using test.client.Client.login when 'django.contrib.sessions' is not in settings.INSTALLED_APPS

Reported by: anonymous Owned by: nobody
Component: Testing framework Version: 1.6-beta-1
Severity: Normal Keywords: test, client, login
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello,

I'm using django session based on cache, so I don't put 'django.contrib.sessions' in INSTALLED_APPS. Everything works fine except the tests (user login attempt always fails).

In django.test.client.Client.login line 549, there is condition:

if user and user.is_active \
     and 'django.contrib.sessions' in settings.INSTALLED_APPS:
   ...

Why do we need this part:

'django.contrib.sessions' in settings.INSTALLED_APPS

?

Change History (2)

comment:1 by Marc Tamlyn, 11 years ago

Triage Stage: UnreviewedAccepted

I think perhaps the check should be for SESSION_BACKEND

comment:2 by Simon Charette, 11 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #7836.

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