<p>To avoid a FileField with a custom storage using AWS S3 (django-storages) to try authenticating when model is saved you can patch the save method of the instance of the storage.
Eg.:
<code>python
class MyTest(TestCase):
@mock.patch('my_app.models.my_s3_boto_storage_instance.save')
def test_create_my_model(self, save):
pass # test model creation</code></p>
By clicking “Accept all”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage and assist in our marketing efforts. Check our privacy policies.