Use unicode in doctests

Posted on Sept. 15, 2009 in django, archive, doctests, python, unicode.

Use hex representation, double quote slashes in expectation. Do not use print in doctests .

""" 
>>> s = u"šđčćž" 
>>> s
u'\\xc5\\xa1\\xc4\\x91\\xc4\\x8d\\xc4\\x87\\xc5\\xbe'
""" 
Share on Reddit