Skip to content
All lessons

Tech Insights

To avoid a FileField with a custom storage using AWS S3 (django-storages) to try authenticating when model is saved you can ...

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.: 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

Shared by

  • Aws S3
  • Django
  • Django Storages
  • Mock
  • Tests

Book a call

Lessons like this one
shape how we build.

Tell us what you’re building. In one call, we’ll show you how our team would approach it.

Tell us what you’re building, and we’ll show you how we’d approach it.

Still prefer the good old email? Contact us