forked from seamusic-official/seamusic-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
33 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,8 @@ services: | |
container_name: pgadmin_app | ||
image: dpage/pgadmin4 | ||
environment: | ||
PGADMIN_DEFAULT_EMAIL: '[email protected]' | ||
PGADMIN_DEFAULT_PASSWORD: '12345678' | ||
PGADMIN_DEFAULT_EMAIL: '[email protected]' | ||
PGADMIN_DEFAULT_PASSWORD: 'qwerty' | ||
ports: | ||
- "5050:80" | ||
networks: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from src.core.config import settings | ||
from src.core.loggers import core as logger | ||
|
||
logger.debug(f'''Database settings: | ||
host={settings.db_host} | ||
port={settings.db_port} | ||
name={settings.db_name} | ||
username={settings.db_user} | ||
password={settings.db_pass} | ||
url={settings.db_url}''') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
import pytest | ||
from fastapi.testclient import TestClient | ||
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker | ||
|
||
from src.api.app import app | ||
from src.core.config import settings | ||
from src.repositories.database.base import SQLAlchemyRepository # noqa: F401 | ||
|
||
engine_test = create_async_engine(settings.db_url_test, echo=True) | ||
sessionmaker_test = async_sessionmaker(engine_test) | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def client() -> TestClient: | ||
return TestClient(app=app) | ||
|
||
|
||
@pytest.fixture(scope='session') | ||
def replace_sessionmaker(mocker): # type: ignore[no-untyped-def] | ||
mocker.patch('SQLAlchemyRepository.sessionmaker', new=sessionmaker_test) | ||
def replace_db_url(mocker): # type: ignore[no-untyped-def] | ||
mocker.patch('settings.db_url', new=settings.db_url_test) |