def test_invalid_method_name_to_decorate(self):
        msg = (
            "The keyword argument `name` must be the name of a method of the "
            "decorated class: <class 'Test'>. Got 'non_existing_method' instead"
        )
        with self.assertRaisesMessage(ValueError, msg):
            @method_decorator(lambda: None, name="non_existing_method")
            class Test(object):
                @classmethod
                def __module__(cls):
                    return "tests"
@method_decorator on a nonexistent method raises an error.
dataset/ETHPy150Open django/django/tests/decorators/tests.py/MethodDecoratorTests.test_invalid_method_name_to_decorate