'Test that account.logOn works, and it calls the right callback when a
connection is established.'

def test_connect(self):

    account = self.makeAccount()
    ui = self.makeUI()
    d = account.logOn(ui)
    account.loginDeferred.callback(None)
    def check(result):
        self.assertFalse(account.loginHasFailed, "Login    shouldn't    have    failed")
        self.assertTrue(account.loginCallbackCalled, 'We    should    be    logged    in')
    d.addCallback(check)
    return d
