File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -147,8 +147,8 @@ def test_bust_cache_production_missing_file():
147
147
def test_bust_cache_production_file_exists (tmpdir ):
148
148
"""Test cache_bust with the right checksum."""
149
149
webcompat .app .config ['LOCALHOST' ] = None
150
- webcompat .templates .STATIC_PATH = tmpdir
150
+ webcompat .templates .STATIC_PATH = ''
151
151
file_path = tmpdir .join ('space.js' )
152
152
file_path .write_text ('punkcat' , encoding = 'utf-8' )
153
153
expected = 'space.js' + '?501753e94c8bfbbbd53c792c9688c8b5'
154
- assert bust_cache ('space.js' ) == expected
154
+ assert expected in bust_cache (str ( file_path ))
Original file line number Diff line number Diff line change @@ -30,8 +30,7 @@ def bust_cache(file_path):
30
30
"""
31
31
if app .config ['LOCALHOST' ]:
32
32
return file_path
33
- absolute_path = os .path .join (STATIC_PATH , file_path )
34
- return file_path + '?' + get_checksum (absolute_path )
33
+ return file_path + '?' + get_checksum (STATIC_PATH + file_path )
35
34
36
35
37
36
def get_checksum (file_path ):
@@ -41,6 +40,7 @@ def get_checksum(file_path):
41
40
except KeyError :
42
41
checksum = md5_checksum (file_path )
43
42
cache_dict [str (file_path )] = checksum
43
+ print ('GET_CHECKSUM (after cache miss)' , cache_dict )
44
44
return checksum
45
45
46
46
You can’t perform that action at this time.
0 commit comments