def __init__(self): message = Message(SuccessParagraph('IF2 was initialised')) dispatcher.send( signal=DYNAMIC_MESSAGE_SIGNAL, sender=self, message=message) self.count = 0
def test_success_paragraph(self): """Tests paragraphs are rendered correctly in plain text/html. """ p = SuccessParagraph("FOO") expected_res = " SUCCESS: FOO\n" res = p.to_text() self.assertEqual(expected_res, res) expected_res = "<p>FOO</p>" res = p.to_html() self.assertEqual(expected_res, res) p1 = SuccessParagraph("FOO", ImportantText("BAR"), "function") expected_res = "<p>FOO <strong>BAR</strong> function</p>" res = p1.to_html() self.assertEqual(expected_res, res)
def test_success_paragraph(self): """Tests paragraphs are rendered correctly in plain text/html. """ p = SuccessParagraph('FOO') expected_res = ' SUCCESS: FOO\n' res = p.to_text() self.assertEqual(expected_res, res) expected_res = '<p>FOO</p>' res = p.to_html() self.assertEqual(expected_res, res) p1 = SuccessParagraph('FOO', ImportantText('BAR'), 'function') expected_res = '<p>FOO <strong>BAR</strong> function</p>' res = p1.to_html() self.assertEqual(expected_res, res)