def test_ensure_str(self): self.assertTrue(isinstance(nodes.ensure_str(u'über'), str)) self.assertEqual(nodes.ensure_str('over'), 'over') if sys.version_info < (3, 0): # strip leading "u" from representation self.assertEqual(nodes.ensure_str(u'über'), r'\xfcber') else: self.assertEqual(nodes.ensure_str(u'über'), r'über')
def test_ensure_str(self): self.assertTrue(isinstance(nodes.ensure_str(u'über'), str)) self.assertEqual(nodes.ensure_str('over'), 'over') if sys.version_info < (3,): # strip leading "u" from representation self.assertEqual(nodes.ensure_str(u'über'), r'\xfcber') else: self.assertEqual(nodes.ensure_str(u'über'), r'über')