1- from multiprocessing import Value
2-
31import dash
42from dash .dependencies import Input , Output
53from dash .exceptions import PreventUpdate
97
108def test_rdif001_sandbox_allow_scripts (dash_duo ):
119 app = dash .Dash (__name__ )
12- call_count = Value ("i" )
1310
1411 N_OUTPUTS = 50
1512
@@ -26,7 +23,6 @@ def update_output(n_clicks):
2623 if n_clicks is None :
2724 raise PreventUpdate
2825
29- call_count .value += 1
3026 return ["{}={}" .format (i , i + n_clicks ) for i in range (N_OUTPUTS )]
3127
3228 @app .server .after_request
@@ -39,6 +35,11 @@ def apply_cors(response):
3935
4036 dash_duo .start_server (app )
4137
38+ dash_duo .find_element ("#btn" ).click ()
39+ dash_duo .wait_for_element ("#output-0" ).text == "0=1"
40+
41+ assert dash_duo .get_logs () == []
42+
4243 iframe = """
4344 <!DOCTYPE html>
4445 <html>
@@ -53,8 +54,9 @@ def apply_cors(response):
5354
5455 dash_duo .driver .switch_to .frame (0 )
5556
56- dash_duo .wait_for_element ("#output-0" )
57- dash_duo .wait_for_element_by_id ("btn" ).click ()
58- dash_duo .wait_for_element ("#output-0" ).text == "0=1"
57+ assert dash_duo .get_logs () == []
58+
59+ dash_duo .find_element ("#btn" ).click ()
60+ dash_duo .wait_for_text_to_equal ("#output-0" , "0=1" )
5961
6062 assert dash_duo .get_logs () == []
0 commit comments