class_docstr: Test that the 'hasparent' flag gets flipped to False
  only if we're sure this object is the real parent.
  
  In ambiguous cases a stale data exception is
  raised.
class_docstr_tok: ["Test","that","the","'hasparent","'","flag","gets","flipped","to","False","only","if","we","'re","sure","this","object","is","the","real","parent",".","In","ambiguous","cases","a","stale","data","exception","is","raised","."]
docstr: illustrate the current behavior of
  expiration on the child.
  
  there's some uncertainty here in how
  this use case should work.
docstr_tok: ["illustrate","the","current","behavior","of","expiration","on","the","child",".","there","'s","some","uncertainty","here","in","how","this","use","case","should","work","."]
code: def test_stale_state_negative_child_expired(self):
      """illustrate the current behavior of
      expiration on the child.
  
      there's some uncertainty here in how
      this use case should work.
  
      """
      User = self.classes.User
      s, u1, a1 = self._fixture()
      gc_collect()
  
      u2 = User(addresses=[a1])  # noqa
  
      s.expire(a1)
      u1.addresses.remove(a1)
  
      u2_is = u2._sa_instance_state
      del u2
  
      for i in range(5):
          gc_collect()
      # heisenberg the GC a little bit, since #7823 caused a lot more
      # GC when mappings are set up, larger test suite started failing
      # on this being gc'ed
      o = u2_is.obj()
      assert o is None
  
      # controversy here.  The action is
      # to expire one object, not the other, and remove;
      # this is pretty abusive in any case. for now
      # we are expiring away the 'parents' collection
      # so the remove will unset the hasparent flag.
      # this is what has occurred historically in any case.
      self._assert_not_hasparent(a1)
  
imports: from sqlalchemy import ForeignKey
  from sqlalchemy import Integer
  from sqlalchemy import testing
  from sqlalchemy.orm import attributes
  from sqlalchemy.orm import exc
  from sqlalchemy.orm import relationship
  from sqlalchemy.testing import assert_raises_message
  from sqlalchemy.testing import eq_
  from sqlalchemy.testing import fixtures
  from sqlalchemy.testing.fixtures import fixture_session
  from sqlalchemy.testing.schema import Column
  from sqlalchemy.testing.schema import Table
  from sqlalchemy.testing.util import gc_collect
label_desc: Use image node_id 10 for calling the ParentRemovalTest obj's underlying member method code with example usage: obj.test_stale_state_negative_child_expired() without return types