Opened 4 years ago

Closed 4 years ago

Last modified 4 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:

Description

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

Repeatable steps:create new project and run manage.py test.

Google groups message - http://groups.google.com/group/django-developers/browse_thread/thread/f0a3db40338b0bd5

Attachments (1)

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

Download all attachments as: .zip

Change History (8)

comment:1 Changed 4 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 4 years ago by yoyoma

It appears that the tests haven't changed since the decoupling of messages from auth. In contrib\messages\tests\user_messages.py 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 4 years ago by gabrielhurley

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 4 years ago by gregmuellegger

  • Owner changed from nobody to gregmuellegger

Changed 4 years ago by gregmuellegger

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

comment:5 Changed 4 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: https://github.com/gregmuellegger/django/commit/af3090bac514716c5455ab1f7b1fbe5813a67be7

comment:6 Changed 4 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 4 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

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