def test_detachWithChildren(self):
        page = self.makePage()
        element = self.elementFactory()
        element.setFragmentParent(page)
        element._athenaID = page.addLocalObject(element)
        child = self.elementFactory()
        child.setFragmentParent(element)
        child._athenaID = page.addLocalObject(child)

        calls = []
        def callRemote(methodName):
            d = Deferred()
            calls.append((methodName, d))
            return d
        element.callRemote = callRemote
        child.callRemote = callRemote

        element.detach()
        self.assertEqual(len(calls), 1)
        self.assertEqual(calls[0][0], '_athenaDetachClient')
        calls[0][1].callback(None)
        self.assertNotIn(element, page.liveFragmentChildren)
        self.assertNotIn(element._athenaID, page._localObjects)
        self.assertIdentical(element.fragmentParent, None)
        self.assertIdentical(element.page, None)
        self.assertNotIn(child, element.liveFragmentChildren)
        self.assertNotIn(child._athenaID, page._localObjects)
        self.assertIdentical(child.fragmentParent, None)
        self.assertIdentical(child.page, None)
Context manager that logs if operations within take longer than
dataset/ETHPy150Open twisted/nevow/nevow/test/test_athena.py/LiveMixinTestsMixin.test_detachWithChildren--crossover with--dataset/ETHPy150Open getlogbook/logbook/logbook/utils.py/logged_if_slow