'L{http.Request.write} casts non-bytes header value to bytes
transparently.'

def test_nonByteHeaderValue(self):

    channel = DummyChannel()
    req = http.Request(channel, False)
    trans = StringTransport()
    channel.transport = trans
    req.setResponseCode(200)
    req.clientproto = 'HTTP/1.0'
    req.responseHeaders.setRawHeaders('test', [10])
    req.write('Hello')
    self.assertResponseEquals(trans.value(), [('HTTP/1.0    200    OK', 'Test:    10', 'Hello')])
    warnings = self.flushWarnings(offendingFunctions=[self.test_nonByteHeaderValue])
    self.assertEqual(1, len(warnings))
    self.assertEqual(warnings[0]['category'], DeprecationWarning)
    self.assertEqual(warnings[0]['message'], 'Passing    non-bytes    header    values    is    deprecated    since    Twisted    12.3.    Pass    only    bytes    instead.')
