#NEWLINE# def test_connect_in_mocking( self ) : #NEWLINE# #INDENT# 'Ensure that the connect() method works properly in mocking.\n        ' #NEWLINE# try : #NEWLINE# #INDENT# import mongomock #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# raise SkipTest ( 'you need mongomock installed to run this testcase' ) #NEWLINE# #UNINDENT# connect ( 'mongoenginetest' , host = 'mongomock://localhost' ) #NEWLINE# conn = get_connection ( ) #NEWLINE# self . assertTrue ( isinstance ( conn , mongomock . MongoClient ) ) #NEWLINE# connect ( 'mongoenginetest2' , host = 'mongomock://localhost' , alias = 'testdb2' ) #NEWLINE# conn = get_connection ( 'testdb2' ) #NEWLINE# self . assertTrue ( isinstance ( conn , mongomock . MongoClient ) ) #NEWLINE# connect ( 'mongoenginetest3' , host = 'mongodb://localhost' , is_mock = True , alias = 'testdb3' ) #NEWLINE# conn = get_connection ( 'testdb3' ) #NEWLINE# self . assertTrue ( isinstance ( conn , mongomock . MongoClient ) ) #NEWLINE# connect ( 'mongoenginetest4' , is_mock = True , alias = 'testdb4' ) #NEWLINE# conn = get_connection ( 'testdb4' ) #NEWLINE# self . assertTrue ( isinstance ( conn , mongomock . MongoClient ) ) #NEWLINE# connect ( host = 'mongodb://localhost:27017/mongoenginetest5' , is_mock = True , alias = 'testdb5' ) #NEWLINE# conn = get_connection ( 'testdb5' ) #NEWLINE# self . assertTrue ( isinstance ( conn , mongomock . MongoClient ) ) #NEWLINE# connect ( host = 'mongomock://localhost:27017/mongoenginetest6' , alias = 'testdb6' ) #NEWLINE# conn = get_connection ( 'testdb6' ) #NEWLINE# self . assertTrue ( isinstance ( conn , mongomock . MongoClient ) ) #NEWLINE# connect ( host = 'mongomock://localhost:27017/mongoenginetest7' , is_mock = True , alias = 'testdb7' ) #NEWLINE# conn = get_connection ( 'testdb7' ) #NEWLINE# self . assertTrue ( isinstance ( conn , mongomock . MongoClient ) )