Added tests for /api/token/ and /api/refresh/#661
Conversation
Also don't look for frontend assets during tests
12d1dc1 to
eaba5de
Compare
|
If you're wondering about the change in config/settings/test.py it is to fix this error: FAILED squarelet/core/tests/test_jwt.py::TestJWTConfiguration::test_refresh_token_is_accepted - django_vite.core.exceptions.DjangoViteAssetNotFoundError: Cannot find frontend/main.ts for app=default in Vite manifest at /home/runner/work/squarelet/squarelet/frontend/dist/manifest.json which occurred in my first run of the tests on Github: The isort fix is because it would be helpful at times if it actually showed us what needs to get swapped in case we want to make a one line change in the Github editor instead of going back to cli to run inv format |
It has happened twice in recent past, where trying to get a refresh token at /api/refresh/ broke after an update of rest framework or a jwt library. These tests would give us a heads up that this breaks before we push to production.
You can test (and I've already confirmed) that making this change in reverse locally makes the tests fail locally because there is an issuer failure.