mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
26 lines
640 B
Python
26 lines
640 B
Python
|
from .models import Role
|
||
|
from flask_migrate import upgrade
|
||
|
|
||
|
|
||
|
def register(app):
|
||
|
@app.cli.command()
|
||
|
def deploy():
|
||
|
"""Run deployment tasks."""
|
||
|
# migrate database to latest revision
|
||
|
upgrade()
|
||
|
# create or update user roles
|
||
|
Role.insert_roles()
|
||
|
|
||
|
@app.cli.command()
|
||
|
def tasks():
|
||
|
from app.tasks import TaskRunner
|
||
|
task_runner = TaskRunner()
|
||
|
task_runner.run()
|
||
|
|
||
|
@app.cli.command()
|
||
|
def test():
|
||
|
"""Run the unit tests."""
|
||
|
import unittest
|
||
|
tests = unittest.TestLoader().discover('tests')
|
||
|
unittest.TextTestRunner(verbosity=2).run(tests)
|