Compare commits

..

1 Commits

Author SHA1 Message Date
c24dbd3ebe Consider real name when searching (#48) 2023-04-20 17:33:19 +02:00
2 changed files with 8 additions and 21 deletions

View File

@ -59,8 +59,6 @@ def seed_user(nickname,
db.session.add(profile)
return profile
def seed(dev: bool):
seed_contacttypes()
@ -147,17 +145,14 @@ def seed(dev: bool):
for i in range(1, 20):
seed_user(f"babsi{i}", visible=True)
dieter = seed_user("dirtydieter",
visible=True,
volunteerwork="Müll sammeln",
availability_status=True,
availability_hours_per_week=24,
availability_text="Nur Nachts!",
freetext="1001010010111!!!",
skills=[(Skill.skill_id_php, 5)])
dieters_address = Address(name="Friedrich Witzig", profile=dieter)
db.session.add(dieters_address)
seed_user("dirtydieter",
visible=True,
volunteerwork="Müll sammeln",
availability_status=True,
availability_hours_per_week=24,
availability_text="Nur Nachts!",
freetext="1001010010111!!!",
skills=[(Skill.skill_id_php, 5)])
all_skills = Skill.query.all()
all_profile_skills = []

View File

@ -99,14 +99,6 @@ class TestFindProfilesEndpoint(ApiTest):
self.assertDictContainsSubset({"nickname": "jutta"}, response.json["profiles"][0])
self.assertDictContainsSubset({"nickname": "monique"}, response.json["profiles"][1])
def test_find_peter_by_name(self):
token = self.login("peter", "geheim")["token"]
response = self.client.get("/users/profiles?search=friedrich", headers={"Authorization": "Bearer " + token})
self.assertEqual(response.status_code, 200)
self.assertDictContainsSubset({"total": 1}, response.json)
self.assertDictContainsSubset({"nickname": "dirtydieter"}, response.json["profiles"][0])
if __name__ == "main":
unittest.main()