add skills integration test

This commit is contained in:
2021-06-13 21:41:01 +02:00
parent ab792ab2aa
commit d387af0f37
5 changed files with 49 additions and 2 deletions

View File

@ -4,11 +4,11 @@ from ki.models import Language, Skill
from app import app, db
@app.cli.command("seed")
def seed():
skill_seed_file_path = app.config["KI_DATA_DIR"] + "/seed_data/skills.csv"
print("importing skills")
with open(skill_seed_file_path) as skills_file:
skills_csv_reader = csv.DictReader(skills_file)
@ -32,3 +32,8 @@ def seed():
db.session.add(Language(id=iso["639-1"], name=iso["Sprache"]))
db.session.commit()
@app.cli.command("seed")
def seed_command():
seed()