Пример #1
0
    def test_html_default_encoding(self):
        body = encode_string(
            '<html><head><title>' \
            '\xc3\x90\xc2\xa2\xc3\x90\xc2\xb5' \
            '\xc3\x91\xc2\x81\xc3\x91\xc2\x82' \
            '</title></head></html>')

        template = self.get_template(body)
        self.assertEqual(template.body, body.decode('utf-8'))
Пример #2
0
    def test_html_default_encoding(self):
        body = encode_string(
            '<html><head><title>' \
            '\xc3\x90\xc2\xa2\xc3\x90\xc2\xb5' \
            '\xc3\x91\xc2\x81\xc3\x91\xc2\x82' \
            '</title></head></html>')

        template = self.get_template(body)
        self.assertEqual(template.body, body.decode('utf-8'))
Пример #3
0
    def test_html_encoding_by_meta(self):
        body = encode_string(
            '<html><head><title>' \
            '\xc3\x92\xc3\xa5\xc3\xb1\xc3\xb2' \
            '</title><meta http-equiv="Content-Type"' \
            ' content="text/html; charset=windows-1251"/>' \
            "</head></html>")

        template = self.get_template(body)
        self.assertEqual(template.body, body.decode('windows-1251'))
Пример #4
0
    def test_html_encoding_by_meta(self):
        body = encode_string(
            '<html><head><title>' \
            '\xc3\x92\xc3\xa5\xc3\xb1\xc3\xb2' \
            '</title><meta http-equiv="Content-Type"' \
            ' content="text/html; charset=windows-1251"/>' \
            "</head></html>")

        template = self.get_template(body)
        self.assertEqual(template.body, body.decode('windows-1251'))