@@ -126,21 +126,23 @@ def test_collect_and_register_resources(mocker):
126126
127127def test_resources_with_attributes ():
128128 """Test that attributes are passed through in external_url resources"""
129- app = dash .Dash (__name__ , serve_locally = False )
129+ app = dash .Dash (__name__ )
130130
131131 # Test external scripts with attributes
132132 resources = app ._collect_and_register_resources (
133133 [
134134 {
135135 "external_url" : "https://example.com/module.js" ,
136136 "attributes" : {"type" : "module" },
137+ "external_only" : True ,
137138 },
138139 {
139140 "external_url" : "https://example.com/script.js" ,
140141 "attributes" : {
141142 "crossorigin" : "anonymous" ,
142143 "integrity" : "sha256-abc123" ,
143144 },
145+ "external_only" : True ,
144146 },
145147 ]
146148 )
@@ -157,18 +159,20 @@ def test_resources_with_attributes():
157159
158160def test_css_resources_with_attributes ():
159161 """Test that attributes are passed through in CSS resources with href"""
160- app = dash .Dash (__name__ , serve_locally = False )
162+ app = dash .Dash (__name__ )
161163
162164 # Test external CSS with attributes
163165 resources = app ._collect_and_register_resources (
164166 [
165167 {
166168 "external_url" : "https://example.com/styles.css" ,
167169 "attributes" : {"media" : "print" },
170+ "external_only" : True ,
168171 },
169172 {
170173 "external_url" : "https://example.com/theme.css" ,
171174 "attributes" : {"crossorigin" : "anonymous" },
175+ "external_only" : True ,
172176 },
173177 ],
174178 url_attr = "href" ,
@@ -182,11 +186,11 @@ def test_css_resources_with_attributes():
182186
183187def test_resources_without_attributes ():
184188 """Test that resources without attributes still work as strings"""
185- app = dash .Dash (__name__ , serve_locally = False )
189+ app = dash .Dash (__name__ )
186190
187191 resources = app ._collect_and_register_resources (
188192 [
189- {"external_url" : "https://example.com/script.js" },
193+ {"external_url" : "https://example.com/script.js" , "external_only" : True },
190194 ]
191195 )
192196
@@ -230,7 +234,7 @@ def test_local_resources_with_attributes(mocker):
230234
231235def test_multiple_external_urls_with_attributes ():
232236 """Test that multiple external URLs with attributes work correctly"""
233- app = dash .Dash (__name__ , serve_locally = False )
237+ app = dash .Dash (__name__ )
234238
235239 resources = app ._collect_and_register_resources (
236240 [
@@ -240,6 +244,7 @@ def test_multiple_external_urls_with_attributes():
240244 "https://example.com/script2.js" ,
241245 ],
242246 "attributes" : {"type" : "module" },
247+ "external_only" : True ,
243248 }
244249 ]
245250 )
0 commit comments