def __unicode__(self): return unicode(self.model) if self.model is not None else quoted( unicode(self.content))
def test_quoted(self): self.assertEqual(quoted('string'), '"string"') self.assertEqual(quoted('first second third'), '"first second third"') self.assertEqual(quoted(u'رشته'), u'"رشته"')
def __unicode__(self): return unicode(self.model) if self.model is not None else quoted(unicode(self.content))