MCPcopy
hub / github.com/django/django / test_ordered

Method test_ordered

tests/messages_tests/tests.py:165–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

163 self.assertMessages(response, [Message(42, "CUSTOM message.")])
164
165 def test_ordered(self):
166 response = FakeResponse()
167 add_message(response.wsgi_request, constants.INFO, "First message.")
168 add_message(response.wsgi_request, constants.WARNING, "Second message.")
169 expected_messages = [
170 Message(constants.WARNING, "Second message."),
171 Message(constants.INFO, "First message."),
172 ]
173 self.assertMessages(response, expected_messages, ordered=False)
174 with self.assertRaisesMessage(AssertionError, "Lists differ: "):
175 self.assertMessages(response, expected_messages)
176
177 def test_mismatching_length(self):
178 response = FakeResponse()

Callers

nothing calls this directly

Calls 5

add_messageFunction · 0.90
MessageClass · 0.90
FakeResponseClass · 0.85
assertMessagesMethod · 0.80
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected