Add and fix tests

This commit is contained in:
2026-03-14 15:34:33 +01:00
parent cb098cb139
commit 171f4a0b9c
6 changed files with 61 additions and 6 deletions

View File

@@ -1,8 +1,13 @@
import os
from unittest import mock
from allmende_payment_system.models import Account
def test_unauthorized_access(unauthorized_client, test_db):
response = unauthorized_client.get("/")
# 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