refactor: make settings a fixture

This commit is contained in:
Vlad Stan
2024-10-17 10:39:57 +02:00
committed by dni ⚡
parent b33abddf3a
commit 7bad0552f6
7 changed files with 96 additions and 90 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