title: Mocking Response Python Unit testing
body: <p>I'm trying to create a mock response and want to set the response.text to some unicode chars. </p>
  
  <p>Here's the code:</p>
  
  <pre><code>class TestClass(TestCase):
      @mock.patch(self, mocked_get)
      def test_func(self):
          mocked_get.side_effect = self.mocked_get
          expected_result = [u'ssemsth']
          result = self.api.query(query_params)
          self.assertEqual(result, expected_result)
  
  def mocked_get(self, *args, **kwargs):
      class MockResponse():
          def test_result():
             res = Response()
             res.message = u'semsmth'
             return res
  
      # some testcondition
      mock_response = MockResponse()
      if self.api.counter == 1:
           return mock_response.test_result()
  </code></pre>
  
  <p>In the result for the response, I'm getting <code>[u'']</code>, a list with empty unicode string. I want to get <code>[u'semsmth']</code></p>
  
  <p>Any thoughts? I'm thinking I can't set the <code>res.message = u'semsth'</code> and just return that. How do I set this attribute for the Response() object i'm sending to the calling test_function</p>