'If TLS is required and the connection is insecure, HELO fallback must
not be honoured, as STARTTLS requires EHLO to succeed.'

def test_requireTLSFailsHELOFallback(self):

    transport = StringTransport()
    self.clientProtocol.requireAuthentication = False
    self.clientProtocol.requireTransportSecurity = True
    self.clientProtocol.heloFallback = True
    self.clientProtocol.makeConnection(transport)
    self.clientProtocol.dataReceived('220    localhost\r\n')
    transport.clear()
    self.clientProtocol.dataReceived('500    not    an    esmtp    server\r\n')
    self.assertEqual('QUIT\r\n', transport.value())
