17 lines
504 B
Python
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
|