Re: POST JSON vs. urlencoded
"John P. Rouillard" <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Ralf, In message <[email protected]>, "John P. Rouillard" writes: >I added a simple POST test that failed under python 2 without the >patch and succeeds with the patch. I just spent the beter part of two hours trying to create a POST test modeled on my existing test with a title of: body='{ "title": "Joe Doe äöüÄÖÜß has problems", \ and I have had no luck trying to make it into a valid test using a bs2b(body) conversion when passing it into BytesIO. To even get the file to parse under python2, I had to add: # -*- coding: utf-8 -*- at the top of the file. My attempts crash under python3 and under python2, I get: self.assertEqual(json_dict['data']['attributes']['title'], > "Joe Doe äöüÄÖÜß has problems") E AssertionError: u'Joe Doe \xe4\xf6\xfc\xc4\xd6\xdc\xdf has problems' != 'Joe Doe \xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c\xc3\x9f has problems ' when trying to compare the value of the title returned by: results = self.server.dispatch('GET', "/rest/data/issue/2", self.empty_form) json_dict = json.loads(b2s(results)) Obviously I have an encoding issue here, but I have no i18n experience so I am kind of lost here. Do you have a test for the case that required you to use the if is_us(val): check? Have a great day. -- -- rouilj John Rouillard =========================================================================== My employers don't acknowledge my existence much less my opinions. _______________________________________________ Roundup-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/roundup-devel