python类create_app()的实例源码

test_api.py 文件源码 项目:SweetHeart 作者: haojunyu 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def setUp(self):
    self.app = create_app()
    self.app_context = self.app.app_context()
    self.app_context.push()
    db.create_all()

  # ??????
test_basics.py 文件源码 项目:SweetHeart 作者: haojunyu 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def setUp(self):
    self.app = create_app('testing')
    self.app_context = self.app.app_context()
    self.app_context.push()
    db.create_all()

  # ??????
conftest.py 文件源码 项目:interact 作者: data-8 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def app():
    """Creates an app with test settings"""
    app = create_app()
    return app
test_comment.py 文件源码 项目:mini 作者: JJWSSS 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def setUp(self):
        self.app = create_app('comment')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.init_app(self.app)
        db.create_all()

        table_structs = self.app.config.get('COMMENT_TABLE_STRUCTS')
        table_structs = copy.deepcopy(table_structs)
        table_structs.pop('__tablename__')
        self.proxy = CommentProxy([key for key, value in table_structs.items()])
test_comment.py 文件源码 项目:mini 作者: JJWSSS 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def setUp(self):
        self.app = create_app('comment')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.init_app(self.app)
        db.create_all()

        table_structs = self.app.config.get('COMMENT_TABLE_STRUCTS')
        table_structs = copy.deepcopy(table_structs)
        table_structs.pop('__tablename__')
        self.proxy = CommentProxy([key for key, value in table_structs.items()])
test_api.py 文件源码 项目:mini 作者: JJWSSS 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def setUp(self):
        self.app = create_app('testing')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.create_all()
        Role.insert_roles()
        self.client = self.app.test_client()
email.py 文件源码 项目:maps4all-signup 作者: hack4impact 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def send_email(recipient, subject, template, **kwargs):
    app = create_app(os.getenv('FLASK_CONFIG') or 'default')
    with app.app_context():
        msg = Message(
            app.config['EMAIL_SUBJECT_PREFIX'] + ' ' + subject,
            sender=app.config['EMAIL_SENDER'],
            recipients=[recipient])
        msg.body = render_template(template + '.txt', **kwargs)
        msg.html = render_template(template + '.html', **kwargs)
        mail.send(msg)
test_basics.py 文件源码 项目:maps4all-signup 作者: hack4impact 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def setUp(self):
        self.app = create_app('testing')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.create_all()
test_user_model.py 文件源码 项目:maps4all-signup 作者: hack4impact 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def setUp(self):
        self.app = create_app('testing')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.create_all()
test_basics.py 文件源码 项目:database_project 作者: HughWen 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def setUp(self):
        self.app = create_app('testing')
        self.app_context = self.app.app_context()
        self.app_context.push()
        db.create_all()


问题


面经


文章

微信
公众号

扫码关注公众号