File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed
Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff 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+ )
Original file line number Diff line number Diff line change 1111@pytest .yield_fixture (scope = 'session' )
1212def 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 :
You can’t perform that action at this time.
0 commit comments