Add and fix tests
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user