openlibhums / janeway

A web-based platform for publishing journals, preprints, conference proceedings, and books
https://janeway.systems/
GNU Affero General Public License v3.0
171 stars 63 forks source link

Add unit tests for Janeway's REST Interface #3376

Open hardyoyo opened 1 year ago

hardyoyo commented 1 year ago

Describe the bug There are no tests written for the Django REST Framework-based Janeway API, other than the OAI tests. The DRF includes a few helper classes that extend Django's existing test framework, and improve support for making API requests. The whole API needs testing.

Janeway version 1.4.3, but any version with the API included lacks tests for anything except the OAI endpoints

To Reproduce Steps to reproduce the behavior:

  1. Go to the src/api/tests folder
  2. Observe that there are only tests written for the OAI endpoints

Expected behavior All endpoints in the API need tests.

Screenshots n/a

Front-end Issues

n/a

Desktop (please complete the following information): n/a

Smartphone (please complete the following information): n/a

Additional context n/a

hardyoyo commented 1 year ago

There’s a whole range of possible tests we could add for the Janeway REST-API, including endpoint tests, serialization tests, authentication tests, pagination tests, and permission tests. Our first priority should be to ensure we have full coverage of all the endpoints (which is what the existing OAI tests are). The endpoints that are lacking coverage are: