def setUpClass(cls):
        class TestRef(Document):
            attr = StringField()

        class TestCls(Document):
            someattr = StringField()
            ref = ReferenceField(TestRef)

        cls.test_ref = TestRef
        cls.test_cls = TestCls

        db = 'SanicMongo-test-unit-{}{}'.format(sys.version_info.major,
                                                sys.version_info.minor)
        connect(db)
Beispiel #2
0
 def setUpClass(cls):
     db = 'SanicMongo-test-unit-{}{}'.format(sys.version_info.major,
                                             sys.version_info.minor)
     connect(db)
Beispiel #3
0
 def setUpClass(cls):
     super().setUpClass()
     connect(db, async_framework='asyncio')
Beispiel #4
0
async def notify_mongo_started(app, loop):
    # db init
    # await lg(1, 'connected to mongo')
    connect(**mongo_cnf)
Beispiel #5
0
async def notify_mongo_started(app, loop):
    connect(host="mongodb://localhost:27017/beepaste")