@@ -34,7 +34,10 @@ def url(self):
34
34
@pytest .fixture
35
35
def freeze (self , monkeypatch ):
36
36
"""Freeze datetime and UUID."""
37
- monkeypatch .setattr ('s3file.forms.S3FileInputMixin.upload_folder' , 'tmp' )
37
+ monkeypatch .setattr (
38
+ 's3file.forms.S3FileInputMixin.upload_folder' ,
39
+ default_storage .location + '/' + 'tmp'
40
+ )
38
41
39
42
def test_value_from_datadict (self , client , upload_file ):
40
43
with open (upload_file ) as f :
@@ -95,7 +98,7 @@ def test_get_conditions(self, freeze):
95
98
assert all (condition in conditions for condition in [
96
99
{"bucket" : 'test-bucket' },
97
100
{"success_action_status" : "201" },
98
- ['starts-with' , '$key' , 'tmp' ],
101
+ ['starts-with' , '$key' , default_storage . location + '/' + 'tmp' ],
99
102
["starts-with" , "$Content-Type" , "" ]
100
103
]), conditions
101
104
@@ -188,5 +191,7 @@ def test_media(self):
188
191
assert ClearableFileInput ().media ._js == ['s3file/js/s3file.js' ]
189
192
190
193
def test_upload_folder (self ):
191
- assert ClearableFileInput ().upload_folder .startswith ('tmp/s3file/' )
192
- assert len (ClearableFileInput ().upload_folder ) == 33
194
+ assert ClearableFileInput ().upload_folder .startswith (
195
+ default_storage .location + '/' + 'tmp/s3file/'
196
+ )
197
+ assert len (ClearableFileInput ().upload_folder ) == 50
0 commit comments