'The C{write} callable returned from C{start_response} only accepts
byte strings.'

def test_writeAcceptsOnlyByteStrings(self):

    def application(environ, startResponse):
        write = startResponse('200    OK', [])
        write(u'bogus')
        return iter(())
    (request, result) = self.prepareRequest(application)
    request.requestReceived()
    def checkMessage(error):
        if _PY3:
            self.assertEqual("Can    only    write    bytes    to    a    transport,    not    'bogus'", str(error))
        else:
            self.assertEqual("Can    only    write    bytes    to    a    transport,    not    u'bogus'", str(error))
    return self.assertFailure(result, TypeError).addCallback(checkMessage)
