Opened 3 years ago

Closed 3 years ago

#17945 closed Bug (invalid)

tests do not change language back after fail, changing template loaders to default before testing

Reported by: andrey@… Owned by: nobody
Component: contrib.auth Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: yes
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.

Also it is possible now to use jinja2 template loaders, which is not compatible with django. django.contrib.auth tests use django templates and application's default template loader. Some tests dies.

Attached patch revers language even if system.exit called and uses django's default template loaders for tests

Attachments (1)

django-tests.patch (2.6 KB) - added by andrey@… 3 years ago.
patch

Download all attachments as: .zip

Change History (3)

Changed 3 years ago by andrey@…

patch

comment:1 Changed 3 years ago by claudep

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

Please don't mix issues in a single tickets. Create separate tickets for each different issue.

comment:2 Changed 3 years ago by claudep

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

Closing as it has been split into #17947 and #17948.

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