コード例 #1
0
ファイル: settings_tests.py プロジェクト: it3s/komoo
    def test_get_db(self):
        db1 = Testing.get_db()
        assert db1
        self.assertEqual(db1.name, Testing.MONGO_DBNAME)

        db2 = Testing.get_db()

        self.assertIs(db1, db2)
コード例 #2
0
 def get_db(cls):
     return Testing.get_db()
コード例 #3
0
 def setUpClass(cls):
     cls.db = Testing.get_db()
     collection = cls.db.cursor_test
     cls.ModelMock.collection = collection
コード例 #4
0
 def get_app(self):
     from settings import Testing
     options = Testing().as_dict()
     return create_app(database_engine=self.database_engine, **options)