'Tests course creation workflow when course organization does not exist
in system.'

@patch.dict('django.conf.settings.FEATURES', {'ORGANIZATIONS_APP': True})
@ddt.data(ModuleStoreEnum.Type.mongo, ModuleStoreEnum.Type.split)
def test_course_creation_with_org_not_in_system(self, store):

    with modulestore().default_store(store):
        response = self.client.ajax_post(self.course_create_rerun_url, {'org': 'orgX', 'number': 'CS101', 'display_name': 'Course    with    web    certs    enabled', 'run': '2015_T2'})
        self.assertEqual(response.status_code, 400)
        data = parse_json(response)
        self.assertIn(u'Organization    you    selected    does    not    exist    in    the    system', data['error'])
