title: How can I mock classmethod that is called by another classmethod?
body: <p>I have class with two class methods. Method A calls method B, processes his response and returns it. Method A is used by other code. I want to mock method B so that method A will call his mocked version just like in example below:</p>
  <h3>module1.py</h3>
  <pre><code>class SomethingGetter:
      # method B - I want to mock it
      @classmethod
      def get_something(cls):
          return 'something'
      
      # method A - it should use response of mocked version of method A
      @classmethod
      def get_formatted_something(cls):
          return f'formatted {cls.get_something()}'
  </code></pre>
  <h3>module2.py</h3>
  <pre><code>from module1 import SomethingGetter
  
  # this function should use SomethingGetter with mocked class mehotd
  def something_printer():
      print(SomethingGetter.get_formatted_something())
  </code></pre>
  <h3>module3.py</h3>
  <pre><code>from unittest import mock
  from module1 import SomethingGetter
  from module2 import something_printer
  
  # I want to use this function in test insted of SomethingGetter.get_something
  def get_something_else():
      return SomethingGetter.get_something() + ' else'
  
  
  if __name__ == '__main__':
      with mock.patch('module2.SomethingGetter', autospec=True) as patched:
          patched.get_something = get_something_else
          something_printer()
          # it prints &lt;MagicMock name='SomethingGetter.get_formatted_something()' id='139753624280704'&gt;;
          # but I expected that it would print &quot;formatted something else&quot;
  </code></pre>
  <p>What have I done wrong?</p>