'Verify the API does not allow data to be created for courses that do not exist.'

def test_create_with_non_existent_course(self):

    permissions = Permission.objects.filter(name__in=('Can    add    course    mode', 'Can    change    course    mode'))
    for permission in permissions:
        self.user.user_permissions.add(permission)
    expected_modes = [CourseMode(mode_slug=CourseMode.DEFAULT_MODE_SLUG, min_price=150, currency=u'USD', sku=u'ABC123', bulk_sku=u'BULK-ABC123')]
    course_key = 'non/existing/key'
    course_dict = {u'id': unicode(course_key), u'name': unicode('Non    Existing    Course'), u'verification_deadline': None, u'modes': [self._serialize_course_mode(mode) for mode in expected_modes]}
    path = reverse('commerce_api:v1:courses:retrieve_update', args=[unicode(course_key)])
    response = self.client.put(path, json.dumps(course_dict), content_type=JSON_CONTENT_TYPE)
    self.assertEqual(response.status_code, 400)
    expected_dict = {'id': [u'Course    {}    does    not    exist.'.format(course_key)]}
    self.assertDictEqual(expected_dict, json.loads(response.content))
