rdmorganiser / rdmo

A tool to support the planning, implementation, and organization of research data management.
https://rdmorganiser.github.io
Apache License 2.0
105 stars 49 forks source link

refactor: prefer admin_client fixture over client.login #1057

Closed afuetterer closed 4 months ago

afuetterer commented 4 months ago

Description

pytest-django offers a admin_client fixture, i.e. a client logged in as an admin user.

Using this fixture reduces the number of "logins" needed in the test suite, offering a tiny performance boost.

It is not "the" rdmo admin (admin:admin), but that was not used in the tests before. So not a problem.

Types of Changes

Checklist

jochenklar commented 4 months ago

Cool, I was not aware of this.

afuetterer commented 4 months ago

In case we ever need the "admin user" (from the fixture accounts.json) the be logged in, we can override the admin_client fixture.