diff --git a/backend/app/api/api_v1/routers/kintone.py b/backend/app/api/api_v1/routers/kintone.py index ff95f1f..57c27c4 100644 --- a/backend/app/api/api_v1/routers/kintone.py +++ b/backend/app/api/api_v1/routers/kintone.py @@ -12,13 +12,13 @@ from app.db.session import SessionLocal from app.db.crud import get_flows_by_app,get_kintoneformat from app.core.auth import get_current_active_user,get_current_user from app.core.apiexception import APIException -from app.db.cruddb.dbdomain import dbdomain +from app.db.cruddb import domainService kinton_router = r = APIRouter() def getkintoneenv(user = Depends(get_current_user)): db = SessionLocal() - domain = dbdomain.get_default_domain(db,user.id) #get_activedomain(db, user.id) + domain = domainService.get_default_domain(db,user.id) #get_activedomain(db, user.id) db.close() kintoneevn = config.KINTONE_ENV(domain) return kintoneevn diff --git a/backend/app/db/cruddb/crudbase.py b/backend/app/db/cruddb/crudbase.py index d3f1ecb..230fc0f 100644 --- a/backend/app/db/cruddb/crudbase.py +++ b/backend/app/db/cruddb/crudbase.py @@ -100,5 +100,5 @@ class crudbase: query = self._apply_filters(query, filters) if sort_by: query = self._apply_sorting(query, sort_by, sort_order) - print(str(query)) + #print(str(query)) return query \ No newline at end of file diff --git a/backend/app/tests/conftest.py b/backend/app/tests/conftest.py index ddefb9f..030e51d 100644 --- a/backend/app/tests/conftest.py +++ b/backend/app/tests/conftest.py @@ -13,7 +13,6 @@ from app.main import app from app.core import security import jwt - SQLALCHEMY_DATABASE_URI = f"postgresql+psycopg2://kabAdmin:P%40ssw0rd!@kintonetooldb.postgres.database.azure.com/test" engine = create_engine(SQLALCHEMY_DATABASE_URI,echo=True) diff --git a/backend/app/tests/pytest.ini b/backend/app/tests/pytest.ini new file mode 100644 index 0000000..c2bbdaf --- /dev/null +++ b/backend/app/tests/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +log_cli = 1 +log_cli_level = CRITICAL +log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s) +log_cli_date_format=%Y-%m-%d %H:%M:%S \ No newline at end of file diff --git a/backend/app/tests/test_auth.py b/backend/app/tests/test_auth.py index 87baee5..c07e023 100644 --- a/backend/app/tests/test_auth.py +++ b/backend/app/tests/test_auth.py @@ -1,6 +1,9 @@ +import logging def test_usr_login(test_client,test_user): response = test_client.post("/api/token", data={"username": test_user["email"], "password": test_user["password"]}) + data = response.json() + logging.error(data) assert response.status_code == 200 assert "access_token" in response.json() assert "token_type" in response.json() diff --git a/backend/app/tests/test_domain.py b/backend/app/tests/test_domain.py index dc3a474..96d8992 100644 --- a/backend/app/tests/test_domain.py +++ b/backend/app/tests/test_domain.py @@ -1,8 +1,9 @@ - +import logging def test_get_domains(test_client,test_domain,login_user): response = test_client.get("/api/domains",headers={"Authorization": "Bearer " + login_user}) - assert response.status_code == 200 data = response.json() + logging.error(data) + assert response.status_code == 200 assert "data" in data assert data["data"] is not None assert len(data["data"]) == 1 diff --git a/backend/app/tests/test_user_app.py b/backend/app/tests/test_user_app.py index a42b07a..068e03e 100644 --- a/backend/app/tests/test_user_app.py +++ b/backend/app/tests/test_user_app.py @@ -1,5 +1,3 @@ - -import json def test_create_flow(test_client,test_domain,test_app_id,login_user): test_flow={ "flowid": "73e82bee-76a2-4347-a069-e21bf5e21111",