File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ def init_app(self, app):
4848 if isinstance (conn_settings , list ):
4949 self .connection = {}
5050 for conn in conn_settings :
51- conn = dict ([ (k .lower (), v ) for k , v in conn .items () if v ] )
51+ conn = dict ((k .lower (), v ) for k , v in conn .items () if v is not None )
5252
5353 if 'replicaset' in conn :
5454 conn ['replicaSet' ] = conn ['replicaset' ]
Original file line number Diff line number Diff line change @@ -75,6 +75,18 @@ def test_connection_kwargs(self):
7575 db .init_app (app )
7676 self .assertFalse (db .connection .tz_aware )
7777
78+ def test_connection_kwargs_with_false_values (self ):
79+ app = flask .Flask (__name__ )
80+ app .config ['MONGODB_SETTINGS' ] = {
81+ 'DB' : 'testing' ,
82+ 'alias' : 'test' ,
83+ 'ssl_validate_hostname' : False
84+ }
85+ app .config ['TESTING' ] = True
86+ db = MongoEngine ()
87+ db .init_app (app )
88+ self .assertFalse (db .connection .ssl_validate_hostname )
89+
7890 def test_with_id (self ):
7991 c = self .app .test_client ()
8092 resp = c .get ('/show/38783728378090/' )
You can’t perform that action at this time.
0 commit comments