Refs #30651 -- Added tests for Message.__eq__().

This commit is contained in:
Mariusz Felisiak 2019-10-01 16:04:44 +02:00
parent 67e7dffe95
commit 0d4b40fe66
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
from django.contrib.messages import constants
from django.contrib.messages.storage.base import Message
from django.test import SimpleTestCase
class MessageTests(SimpleTestCase):
def test_eq(self):
msg_1 = Message(constants.INFO, 'Test message 1')
msg_2 = Message(constants.INFO, 'Test message 2')
msg_3 = Message(constants.WARNING, 'Test message 1')
self.assertEqual(msg_1, msg_1)
self.assertNotEqual(msg_1, msg_2)
self.assertNotEqual(msg_1, msg_3)
self.assertNotEqual(msg_2, msg_3)