-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtest_init_later.py
More file actions
33 lines (26 loc) · 815 Bytes
/
test_init_later.py
File metadata and controls
33 lines (26 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
#
# Test app initialization post constructions
#
# :copyright: 2020 Sonu Kumar
# :license: BSD-3-Clause
#
import unittest
from .test_basic import BasicTest
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from tests.utils import ViewPermission
from error_tracker import AppErrorTracker
class InitLaterTest(BasicTest):
db_prefix = "InitLaterTest"
def _setup(self, db_file):
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///%s" % db_file
db = SQLAlchemy(app)
error_tracker = AppErrorTracker()
error_tracker.init_app(app, db, view_permission=ViewPermission())
db.drop_all()
db.create_all()
return app, db, error_tracker
if __name__ == '__main__':
unittest.main()