Code

Opened 6 years ago

Closed 6 years ago

#9095 closed (duplicate)

Auth has errors in unit tests when Admin isn't in INSTALLED_APPS

Reported by: SamBull Owned by: nobody
Component: contrib.auth Version: 1.0
Severity: Keywords: unittest test templates
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The contrib.auth module fails some of its unit tests with errors if contrib.admin isn't listed in INSTALLED_APPS.

This seems to be because contrib.auth is dependent on these templates:

  • registration/password_change_form.html
  • registration/password_reset_email.html
  • registration/password_reset_form.html

These templates are in contrib/admin/templates/.

These are the tests that are failing:

  • In ChangePasswordTest:
    • test_password_change_fails_with_invalid_old_password
    • test_password_change_fails_with_mismatched_passwords
  • In PasswordResetTest
    • test_confirm_complete
    • test_confirm_different_passwords
    • test_confirm_invalid
    • test_confirm_invalid_post
    • test_confirm_valid
    • "Email is sent if a valid email address is provided for password reset" (test_email_found)

I'm attaching the output from when I run the tests.

PS- There are also errors in the tests if the content type or session applications are missing. This doesn't seem like as much of a problem since those apps are more integral to how auth works. They're also both part of the INSALLED_APPS list by default, unlike the admin app.

Attachments (1)

auth_unit_test_errors.txt (14.4 KB) - added by SamBull 6 years ago.

Download all attachments as: .zip

Change History (2)

Changed 6 years ago by SamBull

comment:1 Changed 6 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #7611. See this mailing list thread for a discussion of the underlying issues. You may also be interested in #4788, which may eventually yield a more attractive solution.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.