Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#25781 closed Cleanup/optimization (fixed)

admin_views tests should mostly use client.force_login()

Reported by: Tim Graham Owned by: Adam
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: awwester@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Some admin_views tests that aren't testing the login view use something like self.client.post(reverse('admin:login'), self.changeuser_login). Since it's not important to test the admin view in these cases, it will be fine to use self.client.force_login(user). Some also have unnecessary calls self.client.get(self.index_url).

Change History (4)

comment:1 Changed 2 years ago by Adam

Cc: awwester@… added
Owner: changed from nobody to Adam
Status: newassigned

comment:3 Changed 2 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 550107ff:

Fixed #25781 -- Simplified admin_views tests with client.force_login()

comment:4 Changed 2 years ago by Tim Graham <timograham@…>

In c598dfa8:

[1.9.x] Fixed #25781 -- Simplified admin_views tests with client.force_login()

Backport of 550107ff756beeb17b465e98c26c59e3dcc5eb3e from master

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