def test_assign_none(self): m = DefaultTestModel() m.save() self.assertEqual(smart_text(m.text), "<p><strong>nice</strong></p>") m.text.raw = None m.save() self.assertEqual(smart_text(m.text), '') self.assertIsNone(m.text.raw) self.assertIsNone(m.text.rendered)
def test_default_value_rendered(self): m = DefaultTestModel() m.save() self.assertEqual( m._meta.get_field('_text_rendered').default, m._meta.get_field('text').default) self.assertEqual(m._text_rendered, "<p><strong>nice</strong></p>")
def test_assign_none(self): m = DefaultTestModel() m.save() self.assertEqual(smart_text(m.text), "<p><strong>nice</strong></p>") m.text.raw = None m.save() self.assertEqual(smart_text(m.text), '') self.assertIsNone(m.text.raw) self.assertIsNone(m.text.rendered)
def test_default_value_rendered(self): m = DefaultTestModel() m.save() self.assertEqual( m._meta.get_field('_text_rendered').default, m._meta.get_field('text').default ) self.assertEqual(m._text_rendered, "<p><strong>nice</strong></p>")
def test_default_text_save(self): m = DefaultTestModel() m.save() self.assertEqual(smart_text(m.text), "<p><strong>nice</strong></p>")
def test_default_text_save(self): m = DefaultTestModel() m.save() self.assertEqual(smart_text(m.text), "<p><strong>nice</strong></p>")