MCPcopy
hub / github.com/django/django / assertRaisesMessage

Method assertRaisesMessage

django/test/testcases.py:866–886  ·  view source on GitHub ↗

Assert that expected_message is found in the message of a raised exception. Args: expected_exception: Exception class expected to be raised. expected_message: expected error message string value. args: Function to be called and extra posi

(
        self, expected_exception, expected_message, *args, **kwargs
    )

Source from the content-addressed store, hash-verified

864 callable_obj(*args, **kwargs)
865
866 def assertRaisesMessage(
867 self, expected_exception, expected_message, *args, **kwargs
868 ):
869 """
870 Assert that expected_message is found in the message of a raised
871 exception.
872
873 Args:
874 expected_exception: Exception class expected to be raised.
875 expected_message: expected error message string value.
876 args: Function to be called and extra positional args.
877 kwargs: Extra kwargs.
878 """
879 return self._assertFooMessage(
880 self.assertRaises,
881 "exception",
882 expected_exception,
883 expected_message,
884 *args,
885 **kwargs,
886 )
887
888 def assertWarnsMessage(self, expected_warning, expected_message, *args, **kwargs):
889 """

Calls 1

_assertFooMessageMethod · 0.95

Tested by

no test coverage detected