Example #1
0
 def test_none(self):
     s = String(None)
Example #2
0
 def test_utf8(self):
     i = u'abc123&é"(§è!çà)ض'
     s1 = String(i)
     s2 = String(i)
     self.assertEqual(s1, s2)
Example #3
0
 def test_empty(self):
     i = ''
     s1 = String(i)
     s2 = String(i)
     self.assertEqual(s1, s2)
Example #4
0
 def test_ascii(self):
     i = 'abc123'
     s1 = String(i)
     s2 = String(i)
     self.assertEqual(s1, s2)
Example #5
0
 def test_none(self):
     i = None
     s = String(i)
     self.assertRaises(TypeError, cmp, s, i)
Example #6
0
 def test_ascii(self):
     i = 'abc123'
     s = String(i)
     self.assertEqual(s, i)
Example #7
0
 def test_empty(self):
     i = ''
     s = String(i)
     self.assertEqual(s, i)
Example #8
0
 def test_empty(self):
     s = String('')
Example #9
0
 def test_utf8(self):
     i = u'abc123&é"(§è!çà)ض'
     s = String(i)
     u = unicode(s)
     self.assertEqual(i, u)
Example #10
0
 def test_very_long_utf8(self):
     i = u'abc123&é"(§è!çà)ض' * 1000
     s = String(i)
     u = unicode(s)
     self.assertEqual(i, u)
Example #11
0
 def test_none(self):
     s = String(None)
     self.assertRaises(ValueError, unicode, s)
Example #12
0
 def test_empty(self):
     i = u''
     s = String(i)
     u = unicode(s)
     self.assertEqual(i, u)
Example #13
0
 def test_utf8(self):
     i = u'abc123&é"(§è!çà)ض'
     s = String(i)
     self.assertRaises(UnicodeEncodeError, str, s)
Example #14
0
 def test_empty(self):
     i = ''
     s = String(i)
     u = str(s)
     self.assertEqual(i, u)
Example #15
0
 def test_utf8(self):
     s = String(u'abc123&é"(§è!çà)ض')