File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -25,4 +25,5 @@ that much better:
2525* Marcus Carlsson - https://github.com/xintron
2626* RealJTG - https://github.com/RealJTG
2727* Peter D. Gray
28- * Massimo Santini
28+ * Massimo Santini
29+ * Len Buckens - https://github.com/buckensl
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def _create_connection(conn_settings):
3131 connections [conn .get ('alias' )] = _create_connection (conn )
3232 return connections
3333
34- conn = dict ([( k .lower (), v ) for k , v in conn_settings .items () if v ])
34+ conn = { k .lower (): v for k , v in conn_settings .items () if v is not None }
3535
3636 if 'replicaset' in conn :
3737 conn ['replicaSet' ] = conn .pop ('replicaset' )
Original file line number Diff line number Diff line change @@ -74,6 +74,17 @@ def test_connection_kwargs(self):
7474 db .init_app (self .app )
7575 self .assertFalse (db .connection .tz_aware )
7676
77+ def test_connection_kwargs_with_false_values (self ):
78+ self .app .config ['MONGODB_SETTINGS' ] = {
79+ 'DB' : 'testing' ,
80+ 'alias' : 'test' ,
81+ 'use_greenlets' : False
82+ }
83+ self .app .config ['TESTING' ] = True
84+ db = MongoEngine ()
85+ db .init_app (self .app )
86+ self .assertFalse (db .connection .use_greenlets )
87+
7788 def test_with_id (self ):
7889 c = self .app .test_client ()
7990 resp = c .get ('/show/38783728378090/' )
You can’t perform that action at this time.
0 commit comments