File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # coding=utf-8
2+ #
13# Copyright 2014 Rustici Software
24#
35# Licensed under the Apache License, Version 2.0 (the "License");
@@ -129,6 +131,15 @@ def test_setters(self):
129131 self .assertIsInstance (resp .response , httplib .HTTPResponse )
130132 self .assertEqual (resp .response , web_resp )
131133
134+ def test_unicode (self ):
135+ resp = LRSResponse ()
136+ resp .data = "\xce \xb4 \xce \xbf \xce \xba \xce \xb9 \xce \xbc \xce \xae " \
137+ "\xcf \x80 \xce \xb5 \xcf \x81 \xce \xb9 \xce \xb5 \xcf \x87 \xce \xbf \xce \xbc \xce \xad \xce \xbd \xce \xbf \xcf \x85 "
138+
139+ self .assertIsInstance (resp , LRSResponse )
140+ self .assertIsInstance (resp .data , unicode )
141+ self .assertEqual (resp .data , u"δοκιμή περιεχομένου" )
142+
132143 def test_setters_none (self ):
133144 resp = LRSResponse ()
134145
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ def data(self, value):
106106 :type value: unicode
107107 """
108108 if value is not None and not isinstance (value , unicode ):
109- unicode ( value )
109+ value = value . decode ( 'utf-8' )
110110 self ._data = value
111111
112112 @property
You can’t perform that action at this time.
0 commit comments