Closed pavel-kalmykov closed 2 months ago
That fixed it. Thanks!
Do you mind if I add an explanatory comment in the testing section about this?
that's fine.
I just created #108. It took me some time because I was on holiday. Could you review it, please? Feel free to close both the issue and PR if everything looks OK.
I will merge it into the upcoming feature branch, which I expect to create soon.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I have a Django app with this model:
And the following test:
And the last assertion,
assert not sample_image_instance.image.storage.exists(image_name)
, is not working.As for the configuration, I am using
pytest-django
with the following properties:And this is my storages setup (using
django-storages
) in settings.py:The thing is that the cleanup works flawlessly when in development mode, as I have a view that looks like this:
And removes the stored images flawlessly.
I tried checking the loaded models as described in the troubleshooting section and I see my model loaded. Additionally,
@pytest.mark.django_db
is equivalent to usingdjango.test.TestCase
(which inherits fromdjango.test.TransactionTestCase
, as the testing section indicates). What am I missing for this to work?