refactor: make settings a fixture

This commit is contained in:
Vlad Stan
2024-10-10 09:08:34 +02:00
committed by dni ⚡
parent 4906bdcc4e
commit 5cb361fe43
7 changed files with 88 additions and 88 deletions
+4 -1
View File
@@ -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