本文整理汇总了Python中mongokit.Connection.drop_collection方法的典型用法代码示例。如果您正苦于以下问题:Python Connection.drop_collection方法的具体用法?Python Connection.drop_collection怎么用?Python Connection.drop_collection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mongokit.Connection
的用法示例。
在下文中一共展示了Connection.drop_collection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FlaskMongoTestCase
# 需要导入模块: from mongokit import Connection [as 别名]
# 或者: from mongokit.Connection import drop_collection [as 别名]
class FlaskMongoTestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
self.raw_app = app
self.app = app.test_client()
self.db = Connection(app.config['MONGODB_HOST'], app.config['MONGODB_PORT'])[app.config['MONGODB_DATABASE']]
def tearDown(self):
self.db.drop_collection("runs")
示例2: FlaskMongoTestCase
# 需要导入模块: from mongokit import Connection [as 别名]
# 或者: from mongokit.Connection import drop_collection [as 别名]
class FlaskMongoTestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
self.app = app.test_client()
self.db = Connection(app.config['MONGODB_HOST'], app.config['MONGODB_PORT'])[app.config['MONGODB_DATABASE']]
with self.app.session_transaction() as sess:
sess['user_email'] = u'[email protected]'
def tearDown(self):
self.db.drop_collection("capability")
self.db.drop_collection("diel")
self.db.drop_collection("taxis")
self.db.drop_collection("lifestage")
self.db.drop_collection("libraries")
self.db.drop_collection("users")