Skip to content
Snippets Groups Projects
Commit 885347f2 authored by Antoine Gaudron-Desjardins's avatar Antoine Gaudron-Desjardins
Browse files

fix

parent 428293ae
Branches
No related tags found
1 merge request!59add test to ci
Pipeline #44577 passed
...@@ -10,6 +10,19 @@ import os ...@@ -10,6 +10,19 @@ import os
client = TestClient(app) client = TestClient(app)
load_dotenv()
user = os.getenv('MYSQL_USER')
password = os.getenv('MYSQL_PASSWORD')
host = os.getenv('DB_HOST')
port = os.getenv('DB_PORT')
database = os.getenv('MYSQL_DATABASE')
SQLALCHEMY_DATABASE_URL = f"mysql+pymysql://{user}:{password}@{host}:{port}/{database}?charset=utf8"
engine = create_engine(SQLALCHEMY_DATABASE_URL)
models.Base.metadata.create_all(bind=engine)
test = { test = {
"restaurant": { "restaurant": {
"place": "restaurant test", "place": "restaurant test",
...@@ -26,20 +39,6 @@ test = { ...@@ -26,20 +39,6 @@ test = {
} }
def init_connection_bdd():
load_dotenv()
user = os.getenv('MYSQL_USER')
password = os.getenv('MYSQL_PASSWORD')
host = os.getenv('DB_HOST')
port = os.getenv('DB_PORT')
database = os.getenv('MYSQL_DATABASE')
SQLALCHEMY_DATABASE_URL = f"mysql+pymysql://{user}:{password}@{host}:{port}/{database}?charset=utf8"
engine = create_engine(SQLALCHEMY_DATABASE_URL)
models.Base.metadata.create_all(bind=engine)
def test_post_opening_hours(): def test_post_opening_hours():
response = client.post( response = client.post(
"/api/opening_hours", "/api/opening_hours",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment