'Verify the Zendesk API is called.'

@httpretty.activate
def test_create_zendesk_ticket(self):

    self._mock_zendesk_api()
    name = u'Test    user'
    email = u'user@example.com'
    subject = u'Test    Ticket'
    body = u'I    want    a    refund!'
    tags = [u'auto_refund']
    self.call_create_zendesk_ticket(name, email, subject, body, tags)
    last_request = httpretty.last_request()
    expected = {u'content-type': JSON, u'Authorization': (u'Basic    ' + base64.b64encode(u'{user}/token:{pwd}'.format(user=ZENDESK_USER, pwd=ZENDESK_API_KEY)))}
    self.assertDictContainsSubset(expected, last_request.headers)
    expected = {u'ticket': {u'requester': {u'name': name, u'email': email}, u'subject': subject, u'comment': {u'body': body}, u'tags': ([u'LMS'] + tags)}}
    self.assertDictEqual(json.loads(last_request.body), expected)
