title: Mocking behavior in python, only care about one of the parameters
body: <p>I am using magic mock for some python testing that I am doing. There is a function</p>
  
  <pre><code>sendmail()
  </code></pre>
  
  <p>which looking at the source code, is defined like this</p>
  
  <pre><code>def sendmail(sender, 
           addrs, 
           subject, 
           body, 
           format               = 'plain', 
           cc                   = [], 
           bcc                  = [], 
           replyTo              = [],
           attach               = [], 
           useOutlook           = False,
           force                = False,  ## UNUSED!
           priority             = None,
           addStandardBobFooter = True
           ):
  </code></pre>
  
  <p>That much isn't really important. What I want my test to do is confirm that this is sending an email with the correct subject. So what I have done so far is...</p>
  
  <pre><code>sendmail = MagicMock()
  self._fundingRollsPublisher.publish()  #this function contains a call to sendmail()
  </code></pre>
  
  <p>and inside the publish code, we have</p>
  
  <pre><code>def publish(): 
  
  #much more code
  sendmail(mail_from, mail_to, subject, body, format = 'html')
  </code></pre>
  
  <p>Sorry for the long winded explanation so far, but that is all the background knowledge. How would I confirm that the send mail function is being called with a given subject... say if I want the subject to be "URGENT", then I want to do something to the effect of </p>
  
  <pre><code>sendmail.assert_called_with(subject= "URGENT")
  </code></pre>
  
  <p>When I tried this, it didn't appear to work. Anyone know of a way to do it where you only care about one of the variables?</p>