'L{twisted.mail.smtp.sendmail} will turn non-file-like objects
(eg. strings) into file-like objects before sending.'

def test_messageStringMadeFile(self):

    reactor = MemoryReactor()
    smtp.sendmail('localhost', 'source@address', 'recipient@address', 'message', reactor=reactor)
    factory = reactor.tcpClients[0][2]
    messageFile = factory.file
    messageFile.seek(0)
    self.assertEqual(messageFile.read(), 'message')
