'Verify badge spec creation works.'

@patch('requests.post')
def test_create_badge(self, post):

    self.handler._create_badge(self.badge_class)
    (args, kwargs) = post.call_args
    self.assertEqual(args[0], 'https://example.com/v1/issuer/issuers/test-issuer/badges')
    self.assertEqual(kwargs['files']['image'][0], self.badge_class.image.name)
    self.assertIsInstance(kwargs['files']['image'][1], ImageFieldFile)
    self.assertEqual(kwargs['files']['image'][2], 'image/png')
    self.check_headers(kwargs['headers'])
    self.assertEqual(kwargs['data'], {'name': 'Test    Badge', 'slug': EXAMPLE_SLUG, 'criteria': 'https://example.com/syllabus', 'description': "Yay!    It's    a    test    badge."})
