MCPcopy
hub / github.com/django/django / test_assertion

Method test_assertion

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

Source from the content-addressed store, hash-verified

103
104class AssertMessagesTest(MessagesTestMixin, SimpleTestCase):
105 def test_assertion(self):
106 response = FakeResponse()
107 add_message(response.wsgi_request, constants.DEBUG, "DEBUG message.")
108 add_message(response.wsgi_request, constants.INFO, "INFO message.")
109 add_message(response.wsgi_request, constants.SUCCESS, "SUCCESS message.")
110 add_message(response.wsgi_request, constants.WARNING, "WARNING message.")
111 add_message(response.wsgi_request, constants.ERROR, "ERROR message.")
112 self.assertMessages(
113 response,
114 [
115 Message(constants.DEBUG, "DEBUG message."),
116 Message(constants.INFO, "INFO message."),
117 Message(constants.SUCCESS, "SUCCESS message."),
118 Message(constants.WARNING, "WARNING message."),
119 Message(constants.ERROR, "ERROR message."),
120 ],
121 )
122
123 def test_with_tags(self):
124 response = FakeResponse()

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected