@@ -64,7 +64,7 @@ def test_get_single_resource_via_filter(self):
6464 self .assertEqual (enumeration .name , 'Foo' )
6565
6666 def test_get_unicode_resource (self ):
67- unicode_name = b'\xcf \x86 oo' .decode ('utf8 ' )
67+ unicode_name = b'\xcf \x86 oo' .decode ('utf-8 ' )
6868 self .response .json .return_value = {'project' : {'name' : unicode_name , 'identifier' : unicode_name , 'id' : 1 }}
6969 project = self .redmine .project .get (unicode_name )
7070 self .assertEqual (project .name , unicode_name )
@@ -94,7 +94,7 @@ def test_create_resource(self):
9494 self .assertEqual (user .lastname , 'Smith' )
9595
9696 def test_create_unicode_resource (self ):
97- unicode_name = b'\xcf \x86 oo' .decode ('utf8 ' )
97+ unicode_name = b'\xcf \x86 oo' .decode ('utf-8 ' )
9898 self .response .status_code = 201
9999 self .response .json .return_value = {'wiki_page' : {'title' : unicode_name , 'project_id' : 1 }}
100100 wiki_page = self .redmine .wiki_page .create (title = unicode_name , project_id = 1 )
@@ -121,7 +121,7 @@ def test_create_resource_with_stream_uploads(self):
121121 'upload' : {'id' : 1 , 'token' : '123456' },
122122 'issue' : {'subject' : 'Foo' , 'project_id' : 1 , 'id' : 1 }
123123 }
124- stream = StringIO (b'\xcf \x86 oo' .decode ('utf8 ' ))
124+ stream = StringIO (b'\xcf \x86 oo' .decode ('utf-8 ' ))
125125 with warnings .catch_warnings (record = True ) as w :
126126 warnings .simplefilter ('always' )
127127 issue = self .redmine .issue .create (project_id = 1 , subject = 'Foo' , uploads = [{'path' : stream }])
@@ -140,7 +140,7 @@ def test_update_resource(self):
140140 self .response .content = ''
141141 manager = self .redmine .wiki_page
142142 manager .params ['project_id' ] = 1
143- self .assertEqual (manager .update (b'\xcf \x86 oo' .decode ('utf8 ' ), title = 'Bar' ), True )
143+ self .assertEqual (manager .update (b'\xcf \x86 oo' .decode ('utf-8 ' ), title = 'Bar' ), True )
144144
145145 @mock .patch ('os.path.isfile' , mock .Mock ())
146146 @mock .patch ('os.path.getsize' , mock .Mock ())
@@ -158,7 +158,7 @@ def test_update_resource_with_stream_uploads(self):
158158 mock .Mock (status_code = 201 , history = [], ** {'json.return_value' : {'upload' : {'id' : 1 , 'token' : '123456' }}}),
159159 mock .Mock (status_code = 200 , history = [], content = '' )
160160 ])
161- stream = StringIO (b'\xcf \x86 oo' .decode ('utf8 ' ))
161+ stream = StringIO (b'\xcf \x86 oo' .decode ('utf-8 ' ))
162162 with warnings .catch_warnings (record = True ) as w :
163163 warnings .simplefilter ('always' )
164164 self .assertEqual (self .redmine .issue .update (1 , subject = 'Bar' , uploads = [{'path' : stream }]), True )
@@ -167,12 +167,12 @@ def test_update_resource_with_stream_uploads(self):
167167
168168 def test_delete_resource (self ):
169169 self .response .content = ''
170- self .assertEqual (self .redmine .wiki_page .delete (b'\xcf \x86 oo' .decode ('utf8 ' ), project_id = 1 ), True )
170+ self .assertEqual (self .redmine .wiki_page .delete (b'\xcf \x86 oo' .decode ('utf-8 ' ), project_id = 1 ), True )
171171
172172 def test_delete_resource_returns_204 (self ):
173173 self .response .status_code = 204
174174 self .response .content = ''
175- self .assertEqual (self .redmine .wiki_page .delete (b'\xcf \x86 oo' .decode ('utf8 ' ), project_id = 1 ), True )
175+ self .assertEqual (self .redmine .wiki_page .delete (b'\xcf \x86 oo' .decode ('utf-8 ' ), project_id = 1 ), True )
176176
177177 def test_resource_get_method_unsupported_exception (self ):
178178 self .assertRaises (exceptions .ResourceBadMethodError , lambda : self .redmine .issue_journal .get (1 ))
0 commit comments