Commit 4cab06d3 authored by Andreas Jung's avatar Andreas Jung

more tests

parent 77a95049
# -*- coding: iso-8859-15 -*-
import unittest
class HTTPResponseTests(unittest.TestCase):
......@@ -86,6 +88,16 @@ class HTTPResponseTests(unittest.TestCase):
response = self._makeOne(body='foo', headers={'content-type': 'application/foo'})
self.assertEqual(response.headers.get('content-type'), 'application/foo; charset=iso-8859-15')
def test_CharsetApplicationHeaderUnicode(self):
response = self._makeOne(body=unicode('rger', 'iso-8859-15'), headers={'content-type': 'application/foo'})
self.assertEqual(response.headers.get('content-type'), 'application/foo; charset=iso-8859-15')
self.assertEqual(response.body, 'rger')
def test_CharsetApplicationHeader1Unicode(self):
response = self._makeOne(body=unicode('rger', 'iso-8859-15'), headers={'content-type': 'application/foo; charset=utf-8'})
self.assertEqual(response.headers.get('content-type'), 'application/foo; charset=utf-8')
self.assertEqual(response.body, unicode('rger', 'iso-8859-15').encode('utf-8'))
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(HTTPResponseTests, 'test'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment