Opened 8 years ago

Closed 8 years ago

#9867 closed (wontfix)

Test client login requires sessions framework to be installed

Reported by: David Sauve <dnsauve@…> Owned by: nobody
Component: Testing framework Version: 1.0
Severity: Keywords: testing test client login session
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Perhaps this is obvious, but the documentation really should mention that in order to use the django.test.client login method with the default auth backend, the INSTALLED_APPS must contain django.contrib.sessions.

Also, the return value of True or False for this method doesn't give any indication of why it has failed. Maybe it should raise an exception if sessions is not installed instead of simply returning False?

Change History (6)

comment:1 Changed 8 years ago by David Sauve <dnsauve@…>

  • Component changed from Uncategorized to Testing framework
  • Keywords testing test client login session added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 8 years ago by ubernostrum

I'm kind of wondering what's needed here; we already document what's needed to use django.contrib.auth in general, so shouldn't it be clear that using django.contrib.auth from tests has the same basic requirements?

comment:3 Changed 8 years ago by David Sauve <dnsauve@…>

It is in retrospect, but at first glance, it might not be so obvious. I think all that would be needed is a brief mention of the requirement.

As for the return values of True/False, they really aren't very informative short of diving into the login source code itself.

comment:4 Changed 8 years ago by ubernostrum

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

What I worry about is exponentially increasing the documentation: if, every time we mention "and you can use app X", we also mention what's necessary to set up app X instead of relying on people to read app X's documentation, we're goign to spend way too much time duplicating requirements documentation all over the place.

So I'm going to wontfix this; if you believe there's a separate issue with the return value, that should be a separate ticket; multiple issues in one ticket is a no-no.

comment:5 Changed 8 years ago by anonymous

  • Resolution wontfix deleted
  • Status changed from closed to reopened

comment:6 Changed 8 years ago by Alex

  • Resolution set to wontfix
  • Status changed from reopened to closed

Please don't reopen tickets that have been closed with good reason.

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