def test_cancelNestedDeferred(self):
        def innerCancel(d):
            self.cancellerCallCount += 1
        def cancel(d):
            self.assert_(False)

        b = defer.Deferred(canceller=innerCancel)
        a = defer.Deferred(canceller=cancel)
        a.callback(None)
        a.addCallback(lambda data: b)
        a.cancel()
        a.addCallbacks(self._callback, self._errback)
        # The cancel count should be one (the cancellation done by B)
        self.assertEquals(self.cancellerCallCount, 1)
        # B's canceller didn't errback, so defer.py will have called errback
        # with a CancelledError.
        self.assertEquals(self.errbackResults.type, defer.CancelledError)
Test Various Chart views
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_defer.py/DeferredCancellerTest.test_cancelNestedDeferred--crossover with--dataset/ETHPy150Open dpgaspar/Flask-AppBuilder/flask_appbuilder/tests/test_base.py/FlaskTestCase.test_charts_view