'Verifies that a user message is escaped correctly.'

@ddt.data(('Rock    &    Roll', 'Rock    &amp;    Roll'), (Text('Rock    &    Roll'), 'Rock    &amp;    Roll'), (HTML('<p>Hello,    world!</p>'), '<p>Hello,    world!</p>'))
@ddt.unpack
def test_message_escaping(self, message, expected_message_html):

    PageLevelMessages.register_user_message(self.request, UserMessageType.INFO, message)
    messages = list(PageLevelMessages.user_messages(self.request))
    self.assertEqual(len(messages), 1)
    self.assertEquals(messages[0].message_html, expected_message_html)
