'Verify an API request created a new CreditCourse object.'

def assert_course_created(self, course_id, response):

    enabled = True
    data = {u'course_key': unicode(course_id), u'enabled': enabled}
    self.assertEqual(response.status_code, 201)
    self.assertDictEqual(json.loads(response.content), data)
    course_key = CourseKey.from_string(course_id)
    self.assertTrue(CreditCourse.objects.filter(course_key=course_key, enabled=enabled).exists())
