def forwards(self, orm):
     # saving will force the conversion of body content to body_html
     for c in orm.Content.objects.all():
         c.body_html = convert_to_html(c.body, c.content_format)
         c.save()
Beispiel #2
0
 def save(self, *args, **kwargs):
     self.body_html = utils.convert_to_html(self.body, self.content_format)
     return super(Content, self).save(*args, **kwargs)
Beispiel #3
0
 def test_convert_to_html_uses_html(self):
     result = utils.convert_to_html(self.html, utils.HTML)
     self.assertTrue("<h4>This is the title</h4>" in result)
Beispiel #4
0
 def test_convert_to_html_uses_plain_text(self):
     result = utils.convert_to_html(self.plain_text, utils.PLAIN_TEXT)
     self.assertTrue("This is text<br />That&#39;s Cool" in result)
Beispiel #5
0
 def test_convert_to_html_uses_rst(self):
     result = utils.convert_to_html(self.reST_text, utils.reST)
     self.assertTrue("<h4>This is text</h4>" in result)