Skip to content

Commit 2385aa7

Browse files
committed
fix: update database settings retrieval in fixtures and skip test for non-Postgres environments
1 parent 488f683 commit 2385aa7

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

guillotina_volto/tests/fixtures.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,13 @@ def base_settings_configurator(settings):
5050
@pytest_asyncio.fixture(scope="function")
5151
async def app_client(event_loop, db, request):
5252
globalregistry.reset()
53-
app = make_app(settings=get_db_settings_volto(request.node), loop=event_loop)
53+
app = make_app(settings=get_db_settings(request.node), loop=event_loop)
5454
async with TestClient(app, timeout=90) as client:
5555
await _clear_dbs(app.app.root)
5656
yield app, client
5757
clear_task_vars()
5858

5959

60-
def get_db_settings_volto(node):
61-
db_settings = get_db_settings(node)
62-
print(db_settings)
63-
db_settings["storages"]["db"] = {"dsn": {"storage": "postgresql", "password": "postgres", "scheme": "postgres"}}
64-
db_settings["databases"]["db"]["dsn"]["password"] = "postgres"
65-
db_settings["databases"]["db-custom"]["dsn"]["password"] = "postgres"
66-
return db_settings
67-
68-
6960
class GuillotinaVoltoDBAsgiRequester(GuillotinaDBAsgiRequester):
7061
def __init__(self, client):
7162
self.client = client

guillotina_volto/tests/test_site.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
from guillotina.tests.test_catalog import NOT_POSTGRES
23

34

45
pytestmark = pytest.mark.asyncio
@@ -14,6 +15,7 @@ async def test_component(cms_requester):
1415
assert len(response["@components"]["actions"]["object"]) > 0
1516

1617

18+
@pytest.mark.skipif(NOT_POSTGRES, reason="Only PG")
1719
async def test_get_database(cms_requester):
1820
response, status = await cms_requester("GET", "/db/guillotina/@database")
1921
assert status == 200

0 commit comments

Comments
 (0)