~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/server/tests/test_schema.py

  • Committer: Alberto Donato
  • Date: 2011-12-01 14:19:12 UTC
  • mto: This revision was merged to the branch mainline in revision 104.
  • Revision ID: alberto.donato@canonical.com-20111201141912-54pen2eyv2o1q23a
Return paramters values as utf8 in errors, if possible.
Convert APIError message to string to avoid problems with twisted logger.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- coding: utf-8 -*-
 
2
 
1
3
from datetime import datetime
2
4
 
3
5
from pytz import UTC, FixedOffset
180
182
        parameter = Unicode("Test")
181
183
        self.assertEqual(u"foo", parameter.parse("foo"))
182
184
 
 
185
    def test_parse_unicode(self):
 
186
        """L{Unicode.parse} works with unicode input."""
 
187
        parameter = Unicode("Test")
 
188
        self.assertEqual(u"cittá", parameter.parse("citt\xc3\xa1"))
 
189
 
183
190
    def test_format(self):
184
191
        """L{Unicode.format} encodes the given C{unicode} with utf-8."""
185
192
        parameter = Unicode("Test")