You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
484 B

  1. import os
  2. from flask_migrate import Migrate
  3. from app import create_app, db
  4. from app.models import User, Role
  5. app = create_app(os.getenv('FLASK_CONFIG') or 'default')
  6. migrate = Migrate(app, db)
  7. @app.shell_context_processor
  8. def make_shell_context():
  9. return dict(db=db, User=User, Role=Role)
  10. @app.cli.command()
  11. def test():
  12. """Run the unit tests."""
  13. import unittest
  14. tests = unittest.TestLoader().discover('tests')
  15. unittest.TextTestRunner(verbosity=2).run(tests)