Update dependency flask-sqlalchemy to v3 #112
@ -88,6 +88,7 @@ def seed_user(auth_id,
|
||||
|
||||
|
||||
def seed(dev: bool):
|
||||
with app.app_context():
|
||||
seed_contacttypes()
|
||||
|
||||
skill_seed_file_path = app.config["KI_DATA_DIR"] + "/seed_data/skills.csv"
|
||||
@ -136,7 +137,8 @@ def seed(dev: bool):
|
||||
skills=[(3, 3), (1, 5)],
|
||||
searchtopics=[3, 1],
|
||||
languages=[("de", 5), ("fr", 3)],
|
||||
address=("Peter Nichtlustig", "Waldweg", "23i", "Hinterhaus", "13337", "Bielefeld", "Deutschland"),
|
||||
address=("Peter Nichtlustig", "Waldweg", "23i", "Hinterhaus", "13337", "Bielefeld",
|
||||
"Deutschland"),
|
||||
contacts=[(4, "@peter:wtf-eg.de"), (1, "peter@wtf-eg.de")])
|
||||
|
||||
seed_user("dirtydieter",
|
||||
|
@ -31,6 +31,7 @@ class ApiTest(unittest.TestCase):
|
||||
self.max_skill_id = max_skill.id
|
||||
|
||||
def tearDown(self):
|
||||
with app.app_context():
|
||||
db.drop_all()
|
||||
db.engine.dispose()
|
||||
|
||||
|
@ -20,6 +20,7 @@ class TestProfileEndpoint(ApiTest):
|
||||
self.assertEqual(login_response.status_code, 200)
|
||||
self.assertIn("token", login_response.json)
|
||||
|
||||
with app.app_context():
|
||||
babsi = User.query.filter(User.auth_id == "babsi1").first()
|
||||
response = self.client.post(f"/users/{babsi.id}/profile",
|
||||
data=json.dumps({}),
|
||||
@ -103,6 +104,7 @@ class TestProfileEndpoint(ApiTest):
|
||||
"level": 2
|
||||
}]
|
||||
}
|
||||
with app.app_context():
|
||||
peter = User.query.filter(User.auth_id == "peter").first()
|
||||
response = self.client.post(f"/users/{peter.id}/profile",
|
||||
data=json.dumps(data),
|
||||
@ -185,6 +187,7 @@ class TestProfileEndpoint(ApiTest):
|
||||
def test_get_visible_proifle(self):
|
||||
token = self.login("peter", "geheim")["token"]
|
||||
|
||||
with app.app_context():
|
||||
babsi = User.query.filter(User.auth_id == "babsi1").first()
|
||||
response = self.client.get(f"/users/{babsi.id}/profile", headers={"Authorization": f"Bearer {token}"})
|
||||
|
||||
@ -197,6 +200,7 @@ class TestProfileEndpoint(ApiTest):
|
||||
self.assertEqual(login_response.status_code, 200)
|
||||
self.assertIn("token", login_response.json)
|
||||
|
||||
with app.app_context():
|
||||
peter = User.query.filter(User.auth_id == "peter").first()
|
||||
response = self.client.get(f"/users/{peter.id}/profile",
|
||||
headers={"Authorization": "Bearer " + login_response.json["token"]})
|
||||
|
Loading…
Reference in New Issue
Block a user