示例#1
0
 def __new__(cls) -> "MongoDBClient":
     if cls.__instance is None:
         cls.__instance = object.__new__(cls)
         app = get_current_app()
         tzinfo = get_timezone()
         cls.__instance.codec_options = CodecOptions(tz_aware=True,
                                                     tzinfo=tzinfo)
         cls.__instance.mongodb = app.mongodb
     return cls.__instance
示例#2
0
def test_get_current_app():
    _app = get_current_app()
    assert _app == app