本文整理汇总了Python中views.app.test_client函数的典型用法代码示例。如果您正苦于以下问题:Python test_client函数的具体用法?Python test_client怎么用?Python test_client使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了test_client函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
app.config['TESTING'] = True
app.config['WTF_CSRF_ENABLED'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
os.path.join(basedir, TEST_DB)
self.app = app.test_client()
db.create_all()
示例2: setUp
def setUp(self):
app.config['TESTING'] = True
db.drop_all()
db.create_all()
self.client = app.test_client()
#add basic data to database
new_drug = drug(DRUGid='e28b7d9c-e817-47c1-b227-97d8eca021a7',\
code='2062', name='杏仁', unit='克', alias=' ',\
py='xr', wb='sw', isClassical='1', SPETid=' ',\
illustration='', createDay='2008-03-25 01=42=59.000',\
optrid='c6543358-354b-4986-a06f-bd61b0cde15d', state='3')
db.session.add(new_drug)
new_fixedrecipe = fixedrecipe(FREPid='65dd5753-aad0-4261-94d3-09a67bd4f9a1',\
code='378', name='华盖散', effect='', py='HGS', wb='WUA', isClassical='1',\
SPETid=' ', illustration='', createDay='2008-03-25 02:05:10.000',\
optrid='c6543358-354b-4986-a06f-bd61b0cde15d', state='3')
db.session.add(new_fixedrecipe)
new_fixedrecipeItem = fixedrecipeItem(FRITid='9c18a29f-faa1-494d-839c-7a89cba439e8',\
DRUGid='e28b7d9c-e817-47c1-b227-97d8eca021a7',\
FREPid='65dd5753-aad0-4261-94d3-09a67bd4f9a1',\
quality='9.0000', sequence='0', illustration='')
db.session.add(new_fixedrecipeItem)
db.session.commit()
示例3: setUp
def setUp(self):
app.config['TESTING'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
os.path.join(basedir, TEST_DIR)
self.app = app.test_client()
db.create_all()
self.michaelUser = ('Michael', '[email protected]', 'python', 'python')
示例4: setUp
def setUp(self):
"""Set up."""
app.config['TESTING'] = True
app.config['WTF_CSRF_ENABLED'] = False
app.config['DEBUG'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
os.path.join(basedir, TEST_DB)
self.app = app.test_client()
db.create_all()
self.assertEquals(app.debug, False)
示例5: setUp
def setUp(self):
"""
Executing prior to each tasks.
Create environnement where tests while be executing.
"""
app.config['TESTING'] = True
app.config['WTF_CSRF_ENABLED'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + \
os.path.join(basedir, TEST_DB)
self.app = app.test_client()
db.create_all()
示例6: setup
def setup(self):
self.app = app.test_client()
示例7: setUp
def setUp(self):
app.config['TESTING'] = True
db.drop_all()
db.create_all()
self.client = app.test_client()
示例8: setUp
def setUp(self):
self.app = app.test_client()
self.maxDiff = None