

@override_settings(MESSAGE_LEVEL=1)
def test_persist_message_levels(self):
    'Test the basic messaging'
    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, '')
        self.assertIsNone(result.expires)
        self.assertIsNotNone(self.created)
        self.assertFalse(result.read)

dataset/ETHPy150Open AliLozano/django-messages-extends/messages_extends/tests.py MessagesTests.test_persist_message_levels/VarMisuse@141/182 `result`->`self`