File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 10
10
from django .core .management import call_command
11
11
from django .db import connections , models
12
12
from django .test import TestCase , TransactionTestCase , modify_settings , override_settings
13
- from pymongo_auth_aws .auth import AwsCredential
14
13
15
14
from django_mongodb_backend .encryption import EqualityQuery
16
15
from django_mongodb_backend .fields import EncryptedFieldMixin
@@ -187,11 +186,16 @@ def setUp(self):
187
186
@classmethod
188
187
def setUpClass (cls ):
189
188
super ().setUpClass ()
189
+ try :
190
+ from pymongo_auth_aws .auth import AwsCredential
191
+
192
+ cls .patch_aws = patch (
193
+ "pymongocrypt.synchronous.credentials.aws_temp_credentials" ,
194
+ return_value = AwsCredential (username = "" , password = "" , token = "" ),
195
+ )
196
+ except ImportError :
197
+ cls .skipTest (cls , "pymongo_auth_aws not installed, skipping AWS credentials tests" )
190
198
191
- cls .patch_aws = patch (
192
- "pymongocrypt.synchronous.credentials.aws_temp_credentials" ,
193
- return_value = AwsCredential (username = "" , password = "" , token = "" ),
194
- )
195
199
cls .patch_aws .start ()
196
200
197
201
cls .patch_azure = patch (
You can’t perform that action at this time.
0 commit comments