Beispiel #1
0
def testdata():
    """create test data."""
    from tigereye.models.cinema import Cinema
    from tigereye.models.movie import Movie
    print('start creating testdata.......')
    Cinema.create_test_data()
    Movie.create_test_data()
Beispiel #2
0
 def setUp(self):
     app = tigereye.create_app(TestConfig)
     # 将所有的logger关掉
     app.logger.disabled = True
     # 创建模拟客户端
     self.app = app.test_client()
     with app.app_context():
         db.create_all()
         Cinema.create_test_data(cinema_num=1, hall_num=3, play_num=3)
         Movie.create_test_data()
Beispiel #3
0
 def setUp(self):
     app = tigereye.create_app(TestConfig)
     app.logger.disabled = True
     self.app = app.test_client()
     with app.app_context():
         from tigereye.models import db
         from tigereye.models.cinema import Cinema
         from tigereye.models.hall import Hall
         from tigereye.models.movie import Movie
         from tigereye.models.order import Order
         from tigereye.models.seat import Seat, PlaySeat
         from tigereye.models.play import Play
         db.create_all()
         Cinema.create_test_data(cinema_num=1, hall_num=3, play_num=3)
         Movie.create_test_data()
Beispiel #4
0
 def setUp(self):
     """Creates the Flask application and the APIManager."""
     app = tigereye.create_app(TestConfig)
     app.logger.disabled = True
     self.flaskapp = app
     self.app = app.test_client()
     with app.app_context():
         from tigereye.extensions import db
         from tigereye.models.cinema import Cinema  # noqa
         from tigereye.models.hall import Hall  # noqa
         from tigereye.models.movie import Movie  # noqa
         from tigereye.models.play import Play  # noqa
         from tigereye.models.seat import Seat  # noqa
         from tigereye.models.seat import PlaySeat  # noqa
         from tigereye.models.order import Order  # noqa
         db.create_all()
         Cinema.create_test_data(cinema_num=1, hall_num=3, play_num=3)
         Movie.create_test_data()
Beispiel #5
0
 def setUp(self):
     app = tigereye.create_app(Testconfig)
     # 关掉日志
     app.logger.disabled = True
     # 不用 不走网络io也能启动接口,创建了test_client
     self.app = app.test_client()
     # 这句和** with open() as f一样,是Python提供的语法糖,可以为提供上下文环境省略简化一部分工作。
     # 这里就简化了其压栈和出栈操作,请求线程创建时,Flask会创建应用上下文对象,
     # 并将其压入flask._app_ctx_stack**的栈中,然后在线程退出前将其从栈里弹出。
     with app.app_context():  #创建了一堆数据库
         from tigereye.models import db
         from tigereye.models.cinema import Cinema
         from tigereye.models.hall import Hall
         from tigereye.models.movie import Movie
         from tigereye.models.play import Play
         from tigereye.models.seat import Seat
         from tigereye.models.order import Order
         from tigereye.helper.code import Code
         db.create_all()
         Cinema.create_test_data(cinema_num=1, hall_num=3, play_num=3)
         Movie.create_test_data()
Beispiel #6
0
def testdata():
    from tigereye.models.cinema import Cinema
    from tigereye.models.movie import Movie
    Cinema.create_test_data()
    Movie.create_test_data()
Beispiel #7
0
def testdata():
    Movie.create_test_data(100)
    Cinema.create_test_data(cinema_num=10)
Beispiel #8
0
def testdata():
    Cinema.create_test_data()