def test_truncate_true(self): c = String(width=2, truncate=True) s2 = c.to_string('hola') self.assertEquals(s2, 'ho') self.assertEquals(c.to_value(s2), 'ho')
def _test(self, value, string, **params): c = String(**params) s2 = c.to_string(value) self.assertEquals(s2, string) self.assertEquals(c.to_value(s2), value)