Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#17947 closed Bug (fixed)

tests do not change language back after fail

Reported by: andrey@… Owned by: Claude Paroz
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently if django management command have error, it calls sys.exit() and after that changes language to previous.

If I run command it is ok – no code executes after sys.exit, but ChangepasswordManagementCommandTestCase? catches SystemExit? exception and continues execution. And all tests after it have incorrect settings. Solution is to use finally to fix this code.

Attachments (1)

django-tests-lang.patch (1.2 KB ) - added by andrey@… 13 years ago.

Download all attachments as: .zip

Change History (6)

by andrey@…, 13 years ago

Attachment: django-tests-lang.patch added

comment:1 by Claude Paroz, 13 years ago

Cc: Claude Paroz removed
Owner: changed from nobody to Claude Paroz
Triage Stage: UnreviewedAccepted

comment:2 by Claude Paroz, 13 years ago

Andrey, is the contrib.auth test change required to fix the bug?

comment:3 by Andrey@…, 13 years ago

Yes, this test previously worked with broken locale and after locale fix it will crash if project uses different language

comment:4 by Claude Paroz, 13 years ago

Resolution: fixed
Status: newclosed

In [17823]:

Fixed #17947 -- Fixed language restore after management command even when exceptions occur. Thanks andrey@… for the report and the patch.

comment:5 by Claude Paroz, 13 years ago

Note that the auth test issue has been fixed seperately in r17811.

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