refactor: make settings a fixture
This commit is contained in:
@@ -18,7 +18,10 @@ from ..helpers import (
|
||||
async def test_create_account(client, settings: Settings):
|
||||
settings.lnbits_allow_new_accounts = False
|
||||
response = await client.post("/api/v1/account", json={"name": "test"})
|
||||
assert response.status_code == 403
|
||||
|
||||
assert response.status_code == 400
|
||||
assert response.json().get("detail") == "Account creation is disabled."
|
||||
|
||||
settings.lnbits_allow_new_accounts = True
|
||||
response = await client.post("/api/v1/account", json={"name": "test"})
|
||||
assert response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user