test_apps.py 535 B

12345678910111213141516
  1. import importlib
  2. from django import forms
  3. from s3file.apps import S3FileConfig
  4. from s3file.forms import S3FileInputMixin
  5. class TestS3FileConfig:
  6. def test_ready(self, settings):
  7. app = S3FileConfig("s3file", importlib.import_module("tests.testapp"))
  8. app.ready()
  9. assert not isinstance(forms.ClearableFileInput(), S3FileInputMixin)
  10. settings.DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
  11. app.ready()
  12. assert isinstance(forms.ClearableFileInput(), S3FileInputMixin)