'Test status messages in a variety of situations.'

@unittest.skipUnless((settings.ROOT_URLCONF == 'lms.urls'), 'Test    only    valid    in    lms')
@ddt.data(('Test    global    message', 'Test    course    message'), (u'    \u0166\u0247s\u0167    s\u0167\u023a\u0167\u1d7es', u'\u1e6a\xeb\u1e61\u1e97    \u010b\xf6\xfc\u1e5b\u1e61\xeb    \u1e61\u1e97\xe4\u1e97\xfc\u1e61    '), (u'', u'\u1e6a\xeb\u1e61\u1e97    \u010b\xf6\xfc\u1e5b\u1e61\xeb    \u1e61\u1e97\xe4\u1e97\xfc\u1e61    '), (u'    \u0166\u0247s\u0167    s\u0167\u023a\u0167\u1d7es', u''))
@ddt.unpack
def test_get_site_status_msg(self, test_global_message, test_course_message):

    self.assertEqual(get_site_status_msg(None), None)
    self.assertEqual(get_site_status_msg(self.course_key), None)
    msg = GlobalStatusMessage.objects.create(message=test_global_message, enabled=True)
    msg.save()
    self.assertEqual(get_site_status_msg(None), test_global_message)
    course_msg = CourseMessage.objects.create(global_message=msg, message=test_course_message, course_key=self.course_key)
    course_msg.save()
    self.assertEqual(get_site_status_msg(self.course_key), u'{}    <br    />    {}'.format(test_global_message, test_course_message))
    msg = GlobalStatusMessage.objects.create(message='', enabled=False)
    msg.save()
    self.assertEqual(get_site_status_msg(None), None)
    self.assertEqual(get_site_status_msg(self.course_key), None)
