use license endpoint for testing instead

This commit is contained in:
Matthias Mair 2024-10-28 23:13:56 +01:00
parent efe3299130
commit 15e38b5b89
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
1 changed files with 4 additions and 4 deletions

View File

@ -45,16 +45,16 @@ class MiddlewareTests(InvenTreeTestCase):
# logout
self.client.logout()
# this should raise a 401
self.check_path(reverse('api-doc'), 302)
self.check_path(reverse('api-license'), 401)
# request with token
self.check_path(reverse('api-doc'), HTTP_Authorization=f'Token {token}')
self.check_path(reverse('api-license'), HTTP_Authorization=f'Token {token}')
# Request with broken token
self.check_path(reverse('api-doc'), 302, HTTP_Authorization='Token abcd123')
self.check_path(reverse('api-license'), 401, HTTP_Authorization='Token abcd123')
# should still fail without token
self.check_path(reverse('api-doc'), 302)
self.check_path(reverse('api-license'), 401)
def test_error_exceptions(self):
"""Test that ignored errors are not logged."""