def test_host_with_port_does_not_get_overridden_by_separate_port_config_value(self):
self.app.config['MONGO_HOST'] = 'localhost:27017'
self.app.config['MONGO_PORT'] = 27018
with warnings.catch_warnings():
# URI connections without a username and password
# work, but warn that auth should be supplied
warnings.simplefilter('ignore')
mongo = flask.ext.pymongo.PyMongo(self.app)
if pymongo.version_tuple[0] > 2:
time.sleep(0.2)
assert ('localhost', 27017) == mongo.cx.address
else:
assert mongo.cx.host == 'localhost'
assert mongo.cx.port == 27017
评论列表
文章目录