Add API tests

This commit is contained in:
rubenwardy
2020-01-19 19:09:04 +00:00
parent fd6ba459f9
commit 0bda16de6d
10 changed files with 149 additions and 14 deletions

View File

@@ -40,6 +40,9 @@ if create_db:
db.create_all()
print("Filling database...")
populate(db.session)
if test_data:
populate_test_data(licenses, tags, User.filter_by(rank=UserRank.ADMIN).first())
populate_test_data(db.session)
db.session.commit()

View File

@@ -1,3 +1,3 @@
#!/bin/sh
docker exec contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py python -m pytest app/tests/ --cov=app --disable-warnings"
docker exec contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py python -m pytest app/tests/ --disable-warnings"

3
utils/tests_cov.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker exec contentdb_app_1 sh -c "FLASK_CONFIG=../config.cfg FLASK_APP=app/__init__.py python -m pytest app/tests/ --cov=app --disable-warnings"