@override_settings(MESSAGE_LEVEL=1)
    def test_persist_message_levels(self):
        user =self._get_user()
        self.client.login(username=user.username, password='password')
        for level in PERSISTENT_MESSAGE_LEVELS:
            msg = 'Test {} - {}'.format(level, datetime.datetime.now())
            messages.add_message(self.client, level, msg)
            result = Message.objects.get(level=level)
            self.assertEqual(result.message, msg)
            self.assertEqual(result.user, user)
            self.assertEqual(result.extra_tags, u'')
            self.assertIsNone(result.expires)
            self.assertIsNotNone(result.created)
            self.assertFalse(result.read)
Test the basic messaging
dataset/ETHPy150Open AliLozano/django-messages-extends/messages_extends/tests.py/MessagesTests.test_persist_message_levels