Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#14632 closed (fixed)

Bug - testing framework fails when contrib.auth not in settings.

Reported by: yoyoma Owned by: gregmuellegger
Component: Testing framework Version: master
Severity: Keywords: tests, sprintnov13
Cc: baxterstockman@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


What happens is that all tests fail with some some of "no table auth_user".

Repeatable steps:create new project and run test.

Google groups message -

Attachments (1)

issue14632.1.diff (3.0 KB) - added by gregmuellegger 6 years ago.
Skipping tests that depend on working User.objects.create(...)

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by yoyoma

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Forgot to add: Remove auth from installed apps.

comment:2 Changed 6 years ago by yoyoma

It appears that the tests haven't changed since the decoupling of messages from auth. In contrib\messages\tests\ on line 13 and 39, you'll see setUp() attempting to attache a user to TestCase, at which point DataBaseError is raised, if auth not in settings.INSTALLED_APPS.

Sorry if this is annoying and redundant information. I just thought it'd help to not have to reproduce the problem, if I included some more details.

comment:3 Changed 6 years ago by gabrielhurley

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 6 years ago by gregmuellegger

  • Owner changed from nobody to gregmuellegger

Changed 6 years ago by gregmuellegger

Skipping tests that depend on working User.objects.create(...)

comment:5 Changed 6 years ago by gregmuellegger

  • Has patch set
  • Keywords sprintnov13 added
  • Triage Stage changed from Accepted to Ready for checkin

A new project created with startproject and 'django.contrib.auth' removed from INSTALLED_APPS should pass all tests now and skip these that depend on django.contrib.auth in django.contrib.messages.

Github commit:

comment:6 Changed 6 years ago by jezdez

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

(In [14557]) Fixed #14632 -- Skip a messages test if auth app is not in INSTALLED_APPS. Thanks, gregmuellegger.

comment:7 Changed 5 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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