I'm writing a Django app, and I use Minio as my object storage. I use this python package.enter link description here I want to create a test bucket for my unit tests. What should I do? In my models.py file, I add a default bucket to save objects; I don't know what I should do for the test request. It is my model:
class PrivateAttachment(models.Model):
file = models.FileField(verbose_name="Object Upload",
storage=MinioBackend(bucket_name='django-backend-dev-private'),
upload_to=iso_date_prefix)
I really appreciate any help you can provide.
Well, if you insist using a
backend-layer
likedjango-minio-backend
, you should find a way adding a test bucket with that layer, documents say you can have multiple buckets by adding the buckets name toMINIO_PRIVATE_BUCKETS
array insettings.py
, give it a shot, add a test bucket name there, run your app and the bucket should be created, so you can refer to your test bucket.