code: def test_cdpr002_updatemodes(dash_dcc):
      app = Dash(__name__)
  
      app.layout = html.Div(
          [
              dcc.DatePickerRange(
                  id="date-picker-range",
                  start_date_id="startDate",
                  end_date_id="endDate",
                  start_date_placeholder_text="Select a start date!",
                  end_date_placeholder_text="Select an end date!",
                  updatemode="bothdates",
              ),
              html.Div(id="date-picker-range-output"),
          ]
      )
  
      @app.callback(
          Output("date-picker-range-output", "children"),
          [
              Input("date-picker-range", "start_date"),
              Input("date-picker-range", "end_date"),
          ],
      )
      def update_output(start_date, end_date):
          return f"{start_date} - {end_date}"
  
      dash_dcc.start_server(app=app)
  
      start_date = dash_dcc.find_element("#startDate")
      start_date.click()
  
      end_date = dash_dcc.find_element("#endDate")
      end_date.click()
  
      assert (
          dash_dcc.find_element("#date-picker-range-output").text
          == "None - None"
      ), "the output should not update when both clicked but no selection happen"
  
      start_date.click()
  
      dash_dcc.find_elements(dash_dcc.date_picker_day_locator)[
          4
      ].click()
      assert (
          dash_dcc.find_element("#date-picker-range-output").text
          == "None - None"
      ), "the output should not update when only one is selected"
  
      eday = dash_dcc.find_elements(dash_dcc.date_picker_day_locator)[
          -4
      ]
      wait.until(
          lambda: eday.is_displayed() and eday.is_enabled(), timeout=2
      )
      eday.click()
  
      date_tokens = set(start_date.get_attribute("value").split("/"))
      date_tokens.update(end_date.get_attribute("value").split("/"))
  
      assert (
          set(
              itertools.chain(
                  *[
                      _.split("-")
                      for _ in dash_dcc.find_element(
                          "#date-picker-range-output"
                      ).text.split(" - ")
                  ]
              )
          )
          == date_tokens
      ), "date should match the callback output"
  
      assert dash_dcc.get_logs() == []
  
imports: import itertools
  import pytest
  from dash import Dash, Input, Output, html, dcc
  import dash.testing.wait
label_desc: Use image node_id 2 for calling a global function with example usage: test_cdpr002_updatemodes(dash_dcc) and returns: start_date, str, end_date