'Test whether transferring a too large amount of money from a dummy wallet raises an error'

@deferred(timeout=10)
def test_transfer_invalid(self):

    test_deferred = Deferred()
    def on_error(failure):
        self.assertIsInstance(failure.value, InsufficientFunds)
        test_deferred.callback(None)
    self.dummy_wallet.transfer((self.dummy_wallet.balance + 1), None).addErrback(on_error)
    return test_deferred
