@@ -277,8 +277,6 @@ def test_get_database_no_existing(self, mock_get_connection):
277
277
278
278
assert database is mock_database
279
279
assert self .backend .__dict__ ['database' ] is mock_database
280
- mock_database .authenticate .assert_called_once_with (
281
- MONGODB_USER , MONGODB_PASSWORD , source = self .backend .database_name )
282
280
283
281
@patch ('celery.backends.mongodb.MongoBackend._get_connection' )
284
282
def test_get_database_no_existing_no_auth (self , mock_get_connection ):
@@ -294,7 +292,6 @@ def test_get_database_no_existing_no_auth(self, mock_get_connection):
294
292
database = self .backend .database
295
293
296
294
assert database is mock_database
297
- mock_database .authenticate .assert_not_called ()
298
295
assert self .backend .__dict__ ['database' ] is mock_database
299
296
300
297
@patch ('celery.backends.mongodb.MongoBackend._get_database' )
@@ -487,18 +484,6 @@ def test_cleanup(self, mock_get_database):
487
484
mock_get_database .assert_called_once_with ()
488
485
mock_collection .delete_many .assert_called ()
489
486
490
- def test_get_database_authfailure (self ):
491
- x = MongoBackend (app = self .app )
492
- x ._get_connection = Mock ()
493
- conn = x ._get_connection .return_value = {}
494
- db = conn [x .database_name ] = Mock ()
495
- db .authenticate .return_value = False
496
- x .user = 'jerry'
497
- x .password = 'cere4l'
498
- with pytest .raises (ImproperlyConfigured ):
499
- x ._get_database ()
500
- db .authenticate .assert_called_with ('jerry' , 'cere4l' ,
501
- source = x .database_name )
502
487
503
488
def test_prepare_client_options (self ):
504
489
with patch ('pymongo.version_tuple' , new = (3 , 0 , 3 )):
0 commit comments