Informatika Mihelac
September 15 2009 django | doctests | python | unicode

Use unicode in doctests

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'
""" 

About

I am Bojan Mihelac and this blog is dedicated to share code, thoughts, tools and advices I came up with while working in Informatika Mihelac.

Contact: bmihelac AT mihelac.org
Twitter: /bmihelac

RSS feedSubscribe to RSS Feed