Code

Opened 6 years ago

Closed 5 years ago

Last modified 3 years ago

#8752 closed (fixed)

auth password tests fail on non-english sites

Reported by: Koen Biermans <koen.biermans@…> Owned by: nobody
Component: Contrib apps Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The password tests in the contrib.auth app rely on a specific string to be in the output, but if the LANGUAGE_CODE setting is not english, those strings will appear translated in the output, causing the tests to fail.

Attachments (1)

auth_tests.diff (1.5 KB) - added by Koen Biermans <koen.biermans@…> 5 years ago.

Download all attachments as: .zip

Change History (11)

Changed 5 years ago by Koen Biermans <koen.biermans@…>

comment:1 Changed 5 years ago by Koen Biermans <koen.biermans@…>

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

The attached patch temporarily overrides LANGUAGES and LANGUAGE_CODE in the auth tests so that english is used as expected by the output.

comment:2 Changed 5 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:3 Changed 5 years ago by jacob

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 5 years ago by boxed

So when will this change be committed? It's quite annoying to see all these bogus fails in the unit test output all the time.

comment:5 Changed 5 years ago by russellm

  • milestone set to 1.1

comment:6 Changed 5 years ago by jacob

I can't reproduce this failure; I have:

    LANGUAGES = (('fr', 'French'),)
    LANGUAGE_CODE = 'fr'

in my settings file, and I don't get any failures.

comment:7 Changed 5 years ago by mtredinnick

Jacob, you also need to have the LocaleMiddleware involved for the automatic translations to have an effect on the tests, so it's more likely to be noticed when testing "auth" as part of an installed set of applications than when testing core.

comment:8 Changed 5 years ago by mtredinnick

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

(In [10599]) Fixed #8752 -- Fixed django.contrib.auth tests to be locale-independent.

Patch from Koen Biermans.

comment:9 Changed 5 years ago by mtredinnick

(In [10600]) [1.0.X] Fixed #8752 -- Fixed django.contrib.auth tests to be locale-independent.

Patch from Koen Biermans.

Backport of r10599 from trunk.

comment:10 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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.