Files
allmende-payment-system/test/test_auth.py
2026-03-14 15:34:33 +01:00

17 lines
504 B
Python

import os
from unittest import mock
from allmende_payment_system.models import Account
def test_unauthorized_access(unauthorized_client, test_db):
# enable production mode to test the authentication mechanism
with mock.patch.dict(os.environ, {"APS_PRODUCTION_MODE": "true"}, clear=False):
response = unauthorized_client.get("/")
assert response.status_code == 401
def test_authorized_access(client, test_db):
response = client.get("/")
assert response.status_code == 200