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:
25
25
* Marcus Carlsson - https://github.com/xintron
26
26
* RealJTG - https://github.com/RealJTG
27
27
* 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):
31
31
connections [conn .get ('alias' )] = _create_connection (conn )
32
32
return connections
33
33
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 }
35
35
36
36
if 'replicaset' in conn :
37
37
conn ['replicaSet' ] = conn .pop ('replicaset' )
Original file line number Diff line number Diff line change @@ -74,6 +74,17 @@ def test_connection_kwargs(self):
74
74
db .init_app (self .app )
75
75
self .assertFalse (db .connection .tz_aware )
76
76
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
+
77
88
def test_with_id (self ):
78
89
c = self .app .test_client ()
79
90
resp = c .get ('/show/38783728378090/' )
You can’t perform that action at this time.
0 commit comments