<reponame>petermirithu/Pitch_web_App<filename>manage.py
from app import create_app,db
from flask_script import Manager,Server
from app.db_class import User,Role,Pitch,Comment
from flask_migrate import Migrate, MigrateCommand

app=create_app('production')
app=create_app('test')

manager=Manager(app)
manager.add_command('server',Server)

migrate=Migrate(app,db)
manager.add_command('db',MigrateCommand)

@manager.command 
def test():
  '''
  function for running unit tests
  '''
  import unittest
  tests=unittest.TestLoader().discover('tests')
  unittest.TextTestRunner(verbosity=2).run(tests)

@manager.shell
def make_shell_context():
  return dict(app=app,db=db,Role=Role,Pitch=Pitch,Comment=Comment,User=User)

if __name__=='__main__':
  manager.run()
  


from app import create_app,db
from flask_script import Manager,Server
from app.db_class import User,Role,Pitch,Comment
from flask_migrate import Migrate, MigrateCommand

app=create_app('production')
app=create_app('test')

manager=Manager(app)
manager.add_command('server',Server)

migrate=Migrate(app,db)
manager.add_command('db',MigrateCommand)

@manager.command 
def test():
  '''
  function for running unit tests
  '''
  import unittest
  tests=unittest.TestLoader().discover('tests')
  unittest.TextTestRunner(verbosity=2).run(tests)

@manager.shell
def make_shell_context():
  return dict(app=app,db=db,Role=Role,Pitch=Pitch,Comment=Comment,User=User)

if __name__=='__main__':
  manager.run()
function for running unit tests