title: Mocking an variable inside function using mock.patch
body: <p>I have problem with mocking testing:</p>
  <pre><code>from module import FUNC
  class A():
    def __init__(self):
      self.var = FUNC()
  
    def test(self):
      var_test = self.var.get()
      return var_test
  </code></pre>
  <p>Now if I want to test function test() I need to mock var_test so what I'm doing is:</p>
  <pre><code>def test_test(self):
    with mock.patch('module.FUNC.get') as mo:
      mo.return_value = &quot;var&quot;
      self.assertIn(&quot;no&quot;, A.test())
  </code></pre>
  <p>Please can someone tell me what I'm doing wrong?</p>