'Check that the task was added to the queue.'

def _assert_queue_task(self, mock_send, cert):

    expected_header = {'lms_key': cert.access_key, 'lms_callback_url': 'https://edx.org/update_example_certificate?key={key}'.format(key=cert.uuid), 'queue_name': 'certificates'}
    expected_body = {'action': 'create', 'username': cert.uuid, 'name': u'John    Do\xeb', 'course_id': unicode(self.COURSE_KEY), 'template_pdf': 'test.pdf', 'example_certificate': True}
    self.assertTrue(mock_send.called)
    (__, kwargs) = mock_send.call_args_list[0]
    actual_header = json.loads(kwargs['header'])
    actual_body = json.loads(kwargs['body'])
    self.assertEqual(expected_header, actual_header)
    self.assertEqual(expected_body, actual_body)
