From 15e38b5b89b17207ebebf14091ab3c530995d906 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 28 Oct 2024 23:13:56 +0100 Subject: [PATCH] use license endpoint for testing instead --- src/backend/InvenTree/InvenTree/test_middleware.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/InvenTree/InvenTree/test_middleware.py b/src/backend/InvenTree/InvenTree/test_middleware.py index 5f84055b80..80b81c4ee2 100644 --- a/src/backend/InvenTree/InvenTree/test_middleware.py +++ b/src/backend/InvenTree/InvenTree/test_middleware.py @@ -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."""