I\'m trying to patch a class method using mock as described in the documentation. The Mock object itself works fine, but its methods don\'t: For example, their attributes like <
I mock classmethods like this:
def raiser(*args, **kwargs): raise forms.ValidationError('foo') with mock.patch.object(mylib.Commands, 'my_class_method', classmethod(raiser)): response=self.admin_client.get(url, data=dict(term='+1000'))