Skip to content
Snippets Groups Projects
Commit 34801bb72594 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[test] Setup S3Storage in a hook

Instead of doing storage attribution in test setup, we implement a test
hook (in test/data/hook.py) as would be done in real application. As a
consequence, we change the way s3 requests are mocked (using moto).
Namely, we introduce a "_s3_client" class method in S3Storage that is
mocked in test setup so that mocking operates in the test hook.

In migration tests, instead of instantiating a new storage object, we
reuse the one bound to Image's data attribute so as to benefit from the
active mock.
parent 8382e8632a2a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment