Opened 9 years ago

Closed 9 years ago

Last modified 9 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: dev
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 by Adam, 9 years ago

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

comment:3 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In 550107ff:

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

comment:4 by Tim Graham <timograham@…>, 9 years ago

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