Jiya3177 commited on
Commit
6a0e5f9
·
1 Parent(s): 50974d4

test: handle unauthenticated status variants

Browse files
backend/tests/test_auth.py CHANGED
@@ -65,7 +65,7 @@ def test_login_invalid_password(client, user):
65
  def test_auth_me_requires_auth(client):
66
  response = client.get("/api/v1/auth/me")
67
 
68
- assert response.status_code == 403
69
 
70
 
71
  def test_refresh_token_success(client, refresh_token):
 
65
  def test_auth_me_requires_auth(client):
66
  response = client.get("/api/v1/auth/me")
67
 
68
+ assert response.status_code in (401, 403)
69
 
70
 
71
  def test_refresh_token_success(client, refresh_token):
backend/tests/test_documents.py CHANGED
@@ -10,7 +10,7 @@ def test_api_health(client):
10
  def test_protected_documents_list_requires_auth(client):
11
  response = client.get("/api/v1/documents/")
12
 
13
- assert response.status_code == 403
14
 
15
 
16
  def test_documents_list_authenticated(client, auth_headers, ready_document):
 
10
  def test_protected_documents_list_requires_auth(client):
11
  response = client.get("/api/v1/documents/")
12
 
13
+ assert response.status_code in (401, 403)
14
 
15
 
16
  def test_documents_list_authenticated(client, auth_headers, ready_document):