File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11
11
from debug_toolbar import panels
12
12
13
13
14
- @dataclass (eq = True , frozen = True )
14
+ @dataclass (eq = True , frozen = True , order = True )
15
15
class StaticFile :
16
16
"""
17
17
Representing the different properties of a static file.
Original file line number Diff line number Diff line change @@ -65,19 +65,25 @@ def test_insert_content(self):
65
65
66
66
def test_path (self ):
67
67
def get_response (request ):
68
- # template contains one static file
69
68
return render (
70
69
request ,
71
70
"staticfiles/path.html" ,
72
- {"path" : Path ("additional_static/base.css" )},
71
+ {
72
+ "paths" : [
73
+ Path ("additional_static/base.css" ),
74
+ Path ("additional_static/base.css" ),
75
+ Path ("additional_static/base2.css" ),
76
+ ]
77
+ },
73
78
)
74
79
75
80
self ._get_response = get_response
76
81
request = RequestFactory ().get ("/" )
77
82
response = self .panel .process_request (request )
78
83
self .panel .generate_stats (self .request , response )
79
- self .assertEqual (self .panel .get_stats ()["num_used" ], 1 )
80
- self .assertIn ('"/static/additional_static/base.css"' , self .panel .content )
84
+ self .assertEqual (self .panel .get_stats ()["num_used" ], 2 )
85
+ self .assertIn ('"/static/additional_static/base.css"' , self .panel .content , 1 )
86
+ self .assertIn ('"/static/additional_static/base2.css"' , self .panel .content , 1 )
81
87
82
88
def test_storage_state_preservation (self ):
83
89
"""Ensure the URLMixin doesn't affect storage state"""
Original file line number Diff line number Diff line change 1
- {% load static %}
2
- {# A single file used twice #}
3
- {% static path %}{% static path %}
1
+ {% load static %}{% for path in paths %}{% static path %}{% endfor %}
You can’t perform that action at this time.
0 commit comments