title: Mocking a return value which is an object
body: <p>I'd like to write some tests for the following code:</p>
  
  <pre><code>def person_name_length(id):
      person = get_person(id)
      return len(person.first_name)
  </code></pre>
  
  <p>How can I mock out <code>get_person(id)</code> method so that it returns an object which has a value for <code>first_name</code> property?</p>
  
  <p>In code:</p>
  
  <pre><code>@patch('get_person')
  def test_person_name_length(self, get_person_mock):
      get_person_mock.return_value = # what goes here??? calling .first_name on it should return 'Bob'
      self.assertEqual(person_name_length(1), 3)
  </code></pre>