title: Python's assert_has_calls throws AssertionError that calls were not found
body: <p>I am trying to write a unit test that tests my coordinator class' function for sending data to a producer that I have mocked. I went a little crazy adding print statements to see what is going on where, and I'm not sure if that is useful but I'm going to include those. The actual mocking seems to be working from looking at the print statements, however my assert_has_calls throws an Assertion Error that calls were not found.  What did I do wrong?</p>
  
  <p>I am using Python 2.7.10 and Mock 2.0.0</p>
  
  <p>Here is my test:</p>
  
  <pre><code>@mock.patch('mypackage.producer.Producer', autospec=True)
  def test_send_data(self, mock_producer):
      coor = mypackage.MyCoordinator()
      # Make sure we initialized the mocked producer with no values
      mock_producer.assert_called_with(None, None, None, None)
  
      # Create some data and send it to the producer
      for count in range(11):
          jsonToSend = {"objectID": 'test{}'.format(count)}
          coor.send_data(jsonToSend, None)
          print 'Sent message %s' % (jsonToSend) 
  
      # Verify the producer was called
      assert mock_producer.called is True
  
      print '\nMethod Calls:'
      print mock_producer.method_calls
      print '\nCall Args List:'
      print mock_producer.call_args_list
      print mock_producer.send_message.call_args_list
      print '\nAll Calls:'
      print mock_producer.mock_calls
  
      calls = [
          mock.call().start(),
          mock.call().send_message({"objectID": "test1"}, None),
          mock.call().send_message({"objectID": "test2"}, None),
          mock.call().send_message({"objectID": "test3"}, None)]
  
      # Verify that the mocks have been called correctly
      mock_producer.assert_has_calls(calls)
  </code></pre>
  
  <p>Here is the output:</p>
  
  <pre><code>Sent message {'objectID': 'test0'}
  Sent message {'objectID': 'test1'}
  Sent message {'objectID': 'test2'}
  Sent message {'objectID': 'test3'}
  Sent message {'objectID': 'test4'}
  Sent message {'objectID': 'test5'}
  Sent message {'objectID': 'test6'}
  Sent message {'objectID': 'test7'}
  Sent message {'objectID': 'test8'}
  Sent message {'objectID': 'test9'}
  Sent message {'objectID': 'test10'}
  
  Method Calls:
  [call().start(),
   call().send_message({'objectID': 'test0'}, None),
   call().send_message({'objectID': 'test1'}, None),
   call().send_message({'objectID': 'test2'}, None),
   call().send_message({'objectID': 'test3'}, None),
   call().send_message({'objectID': 'test4'}, None),
   call().send_message({'objectID': 'test5'}, None),
   call().send_message({'objectID': 'test6'}, None),
   call().send_message({'objectID': 'test7'}, None),
   call().send_message({'objectID': 'test8'}, None),
   call().send_message({'objectID': 'test9'}, None),
   call().send_message({'objectID': 'test10'}, None)]
  
  Call Args List:
  [call(None, None, None, None)]
  []
  
  All Calls:
  [call(None, None, None, None),
   call().start(),
   call().send_message({'objectID': 'test0'}, None),
   call().send_message({'objectID': 'test1'}, None),
   call().send_message({'objectID': 'test2'}, None),
   call().send_message({'objectID': 'test3'}, None),
   call().send_message({'objectID': 'test4'}, None),
   call().send_message({'objectID': 'test5'}, None),
   call().send_message({'objectID': 'test6'}, None),
   call().send_message({'objectID': 'test7'}, None),
   call().send_message({'objectID': 'test8'}, None),
   call().send_message({'objectID': 'test9'}, None),
   call().send_message({'objectID': 'test10'}, None)]
  ======================================================================
  FAIL: test_send_data (kafka_api_test.KafkaApiTest)
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "C:\Anaconda2\lib\site-packages\mock\mock.py", line 1305, in patched
      return func(*args, **keywargs)
    File "C:/Users/myuser/workspace/MyProject/tests/my_test.py", line 76, in test_send_data
      mock_producer.assert_has_calls(calls)
    File "C:\Anaconda2\lib\site-packages\mock\mock.py", line 969, in assert_has_calls
      ), cause)
    File "C:\Anaconda2\lib\site-packages\six.py", line 718, in raise_from
      raise value
  AssertionError: Calls not found.
  Expected: [call().start(),
   call().send_message({'objectID': 'test1'}, None),
   call().send_message({'objectID': 'test2'}, None),
   call().send_message({'objectID': 'test3'}, None)]
  Actual: [call(None, None, None, None),
   call().start(),
   call().send_message({'objectID': 'test0'}, None),
   call().send_message({'objectID': 'test1'}, None),
   call().send_message({'objectID': 'test2'}, None),
   call().send_message({'objectID': 'test3'}, None),
   call().send_message({'objectID': 'test4'}, None),
   call().send_message({'objectID': 'test5'}, None),
   call().send_message({'objectID': 'test6'}, None),
   call().send_message({'objectID': 'test7'}, None),
   call().send_message({'objectID': 'test8'}, None),
   call().send_message({'objectID': 'test9'}, None),
   call().send_message({'objectID': 'test10'}, None)]
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Just to see what happens I also tried changing the assert statement to <code>mock_producer.assert_has_calls(mock_producer.mock_calls)</code> but that fails with the error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Anaconda2\lib\site-packages\mock\mock.py", line 1305, in patched
      return func(*args, **keywargs)
    File "C:/Users/myuser/workspace/MyProject/tests/my_test.py", line 73, in test_send_data
      mock_producer.assert_has_calls(mock_producer.mock_calls)
    File "C:\Anaconda2\lib\site-packages\mock\mock.py", line 969, in assert_has_calls
      ), cause)
    File "C:\Anaconda2\lib\site-packages\six.py", line 718, in raise_from
      raise value
  AssertionError: Calls not found.
  Expected: [call(None, None, None, None),
   call().start(),
   call().send_message({'objectID': 'test0'}, None),
   call().send_message({'objectID': 'test1'}, None),
   call().send_message({'objectID': 'test2'}, None),
   call().send_message({'objectID': 'test3'}, None),
   call().send_message({'objectID': 'test4'}, None),
   call().send_message({'objectID': 'test5'}, None),
   call().send_message({'objectID': 'test6'}, None),
   call().send_message({'objectID': 'test7'}, None),
   call().send_message({'objectID': 'test8'}, None),
   call().send_message({'objectID': 'test9'}, None),
   call().send_message({'objectID': 'test10'}, None),
   call().send_message({'objectID': 'test11'}, 'done')]
  Actual: [call(None, None, None, None),
   call().start(),
   call().send_message({'objectID': 'test0'}, None),
   call().send_message({'objectID': 'test1'}, None),
   call().send_message({'objectID': 'test2'}, None),
   call().send_message({'objectID': 'test3'}, None),
   call().send_message({'objectID': 'test4'}, None),
   call().send_message({'objectID': 'test5'}, None),
   call().send_message({'objectID': 'test6'}, None),
   call().send_message({'objectID': 'test7'}, None),
   call().send_message({'objectID': 'test8'}, None),
   call().send_message({'objectID': 'test9'}, None),
   call().send_message({'objectID': 'test10'}, None),
   call().send_message({'objectID': 'test11'}, 'done')]
  </code></pre>
  
  <p>Based on the mock documentation, I would think that that should have succeeded since assert_has_calls compares the expected values with those in the mock_calls list. Is that logic incorrect?</p>