Skip to content

Commit 728e83e

Browse files
committed
Fix test suite
1 parent f5fd693 commit 728e83e

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

s3file/apps.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ class S3FileConfig(AppConfig):
88
def ready(self):
99
from django.core.files.storage import default_storage
1010
from storages.backends.s3boto3 import S3Boto3Storage
11+
from django import forms
12+
from .forms import S3FileInputMixin
1113

12-
if isinstance(default_storage, S3Boto3Storage):
13-
from django import forms
14-
from .forms import S3FileInputMixin
14+
if isinstance(default_storage, S3Boto3Storage) and \
15+
S3FileInputMixin not in forms.ClearableFileInput.__bases__:
16+
forms.ClearableFileInput.__bases__ = \
17+
(S3FileInputMixin,) + forms.ClearableFileInput.__bases__
1518

16-
if S3FileInputMixin not in forms.ClearableFileInput.__bases__:
17-
forms.ClearableFileInput.__bases__ = \
18-
(S3FileInputMixin,) + forms.ClearableFileInput.__bases__
19+
elif S3FileInputMixin in forms.ClearableFileInput.__bases__:
20+
forms.ClearableFileInput.__bases__ = tuple(
21+
cls for cls in forms.ClearableFileInput.__bases__
22+
if cls is not S3FileInputMixin
23+
)

tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
@pytest.yield_fixture(scope='session')
1212
def driver():
1313
chrome_options = webdriver.ChromeOptions()
14-
chrome_options.add_argument('headless')
15-
chrome_options.add_argument('window-size=1200x800')
14+
chrome_options.headless = True
1615
try:
1716
b = webdriver.Chrome(options=chrome_options)
1817
except WebDriverException as e:

0 commit comments

Comments
 (0)