Compare commits

...

5 Commits

Author SHA1 Message Date
a99dbe5016 fix linter issues 2024-03-19 20:51:22 +01:00
8540623961 fix linter issues 2024-03-19 20:47:09 +01:00
4529b07d54 fix linter issues 2024-03-19 20:46:22 +01:00
86c2d7e84a fix linter issues 2024-03-19 20:44:49 +01:00
eeb01bf6e8 fix linter issues 2024-03-19 20:14:48 +01:00
3 changed files with 23 additions and 31 deletions

View File

@ -1,5 +1,4 @@
# SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/> # SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/>
#
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
import csv import csv

View File

@ -1,5 +1,4 @@
# SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/> # SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/>
#
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
from alembic import command from alembic import command
@ -9,7 +8,6 @@ import unittest
from app import app, db, migrate from app import app, db, migrate
from ki.actions import seed from ki.actions import seed
from ki.models import Skill from ki.models import Skill
from sqlalchemy import select from sqlalchemy import select
@ -26,7 +24,6 @@ class ApiTest(unittest.TestCase):
self.client = app.test_client() self.client = app.test_client()
config = migrate.get_config() config = migrate.get_config()
with app.app_context(): with app.app_context():
command.upgrade(config, "head") command.upgrade(config, "head")
seed(True) seed(True)
@ -37,17 +34,14 @@ class ApiTest(unittest.TestCase):
# print(skill_obj) # print(skill_obj)
# statement = select(Skill.id) # statement = select(Skill.id)
# print(statement) # print(statement)
# max_skill = db.session.Skill().order_by(Skill.id.desc()).first() # max_skill = db.session.Skill().order_by(Skill.id.desc()).first()
# max_skill = Skill.query.order_by(Skill.id.desc()).first() # TODO: problematic # max_skill = Skill.query.order_by(Skill.id.desc()).first() # TODO: problematic
with db.session.no_autoflush: # only works on first test run with db.session.no_autoflush: # only works on first test run
max_skill = db.session.query(Skill).order_by(Skill.id.desc()).first() # TODO: also problematic, max_skill = db.session.query(Skill).order_by(Skill.id.desc()).first() # TODO: also problematic,
# skills = db.session.execute(db.select(Skill)).scalars() # skills = db.session.execute(db.select(Skill)).scalars()
# print(max_skill) # print(max_skill)
# max_skill = db.session.execute(db.select(Skill) # max_skill = db.session.execute(db.select(Skill)
## .order_by(Skill.id.desc()) # .order_by(Skill.id.desc())
# ).scalar_one() # ).scalar_one()
print(max_skill) print(max_skill)
print("max_skill done") print("max_skill done")

View File

@ -1,5 +1,4 @@
# SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/> # SPDX-FileCopyrightText: WTF Kooperative eG <https://wtf-eg.de/>
#
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
import unittest import unittest