class_docstr: Tests for every flavor of form/deltagenerator association.
class_docstr_tok: ["Tests","for","every","flavor","of","form\/deltagenerator","association","."]
docstr: Within a `with form` statement, any `st.foo` element becomes
  part of that form.
code: def test_implicit_form_parent(self):
      """Within a `with form` statement, any `st.foo` element becomes
      part of that form."""
      with st.form("form"):
          st.checkbox("widget")
      self.assertEqual("form", self._get_last_checkbox_form_id())
  
      # The sidebar, and any other DG parent created outside
      # the form, does not create children inside the form.
      with st.form("form2"):
          st.sidebar.checkbox("widget2")
      self.assertEqual(NO_FORM_ID, self._get_last_checkbox_form_id())
  
imports: from unittest.mock import MagicMock, patch
  import streamlit
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.state.session_state import RegisterWidgetResult
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 3 for calling the FormAssociationTest obj's underlying member method code with example usage: obj.test_implicit_form_parent() without return types