From 86c2d7e84ad42f0d6699c902235fee9e98852d55 Mon Sep 17 00:00:00 2001 From: srsh Date: Tue, 19 Mar 2024 20:44:49 +0100 Subject: [PATCH] fix linter issues --- ki/actions/seed.py | 7 +++---- ki/test/ApiTest.py | 5 ++--- ki/test/test_contacttypes_endpoint.py | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ki/actions/seed.py b/ki/actions/seed.py index 5c728be..c139613 100644 --- a/ki/actions/seed.py +++ b/ki/actions/seed.py @@ -1,5 +1,4 @@ # SPDX-FileCopyrightText: WTF Kooperative eG -# # SPDX-License-Identifier: AGPL-3.0-or-later import csv @@ -147,13 +146,13 @@ def seed(dev: bool): freetext="1001010010111!!!", skills=[(1, 5)], address=("Friedrich Witzig", "", "", "", "", "", "")) - #all_skills = [(skill.id, 3) for skill in Skill.query.all()] # query causes problems - #seed_user("jutta", languages=[("fr", 5)], skills=all_skills) + # all_skills = [(skill.id, 3) for skill in Skill.query.all()] # query causes problems + # seed_user("jutta", languages=[("fr", 5)], skills=all_skills) seed_user("giesela", skills=[(9, 3), (10, 5)]) seed_user("bertha", visible=False, skills=[(11, 3), (10, 5)]) seed_user("monique", languages=[("fr", 4)]) print("seeding done") with app.app_context(): - db.session.commit() # also problematic + db.session.commit() # also problematic print("commit done") diff --git a/ki/test/ApiTest.py b/ki/test/ApiTest.py index f82611c..98d7a18 100644 --- a/ki/test/ApiTest.py +++ b/ki/test/ApiTest.py @@ -1,5 +1,4 @@ # SPDX-FileCopyrightText: WTF Kooperative eG -# # SPDX-License-Identifier: AGPL-3.0-or-later from alembic import command @@ -39,8 +38,8 @@ class ApiTest(unittest.TestCase): # print(statement) # max_skill = db.session.Skill().order_by(Skill.id.desc()).first() # max_skill = Skill.query.order_by(Skill.id.desc()).first() # TODO: problematic - 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, + 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, # skills = db.session.execute(db.select(Skill)).scalars() # print(max_skill) # max_skill = db.session.execute(db.select(Skill) diff --git a/ki/test/test_contacttypes_endpoint.py b/ki/test/test_contacttypes_endpoint.py index 28d3500..e55977b 100644 --- a/ki/test/test_contacttypes_endpoint.py +++ b/ki/test/test_contacttypes_endpoint.py @@ -1,5 +1,4 @@ # SPDX-FileCopyrightText: WTF Kooperative eG -# # SPDX-License-Identifier: AGPL-3.0-or-later import unittest @@ -10,7 +9,7 @@ from ki.test.ApiTest import ApiTest class TestContactTypesEndpoint(ApiTest): def test_skills_options(self): print("test_skills_options") - #with app.app_context(): + # with app.app_context(): response = self.client.options("/contacttypes") self.assertEqual(response.status_code, 200) self.assertIn("Access-Control-Allow-Origin", response.headers)