''

def test_interactive_environ_plugin_load(self):

    jupyter_config = utility.clean_multiline_string('                                <?xml    version="1.0"    encoding="UTF-8"?>\n                                <!DOCTYPE    interactive_environment    SYSTEM    "../../interactive_environments.dtd">\n                                <interactive_environment    name="Jupyter">\n                                                <data_sources>\n                                                                <data_source>\n                                                                                <model_class>HistoryDatasetAssociation</model_class>\n                                                                                <test    type="isinstance"    test_attr="datatype"    result_type="datatype">tabular.Tabular</test>\n                                                                                <test    type="isinstance"    test_attr="datatype"    result_type="datatype">data.Text</test>\n                                                                                <to_param    param_attr="id">dataset_id</to_param>\n                                                                </data_source>\n                                                </data_sources>\n                                                <params>\n                                                                <param    type="dataset"    var_name_in_template="hda"    required="true">dataset_id</param>\n                                                </params>\n                                                <template>jupyter.mako</template>\n                                </interactive_environment>\n                                ')
    mock_app_dir = {'plugins': {'jupyter': {'config': {'jupyter.xml': jupyter_config}, 'templates': {}}}}
    jupyter_template = '${    ie_request    }-${    get_api_key()    }'
    mock_app_dir['plugins']['jupyter']['templates']['jupyter.mako'] = jupyter_template
    mock_app_dir['caches'] = {}
    mock_app_dir = galaxy_mock.MockDir(mock_app_dir)
    mock_app = galaxy_mock.MockApp(root=mock_app_dir.root_path)
    plugin_mgr = VisualizationsRegistry(mock_app, directories_setting='plugins', template_cache_dir=os.path.join(mock_app_dir.root_path, 'caches'))
    expected_plugins_path = os.path.join(mock_app_dir.root_path, 'plugins')
    expected_plugin_names = ['jupyter']
    self.assertEqual(plugin_mgr.base_url, 'visualizations')
    self.assertEqual(plugin_mgr.directories, [expected_plugins_path])
    self.assertEqual(sorted(plugin_mgr.plugins.keys()), expected_plugin_names)
    jupyter = plugin_mgr.plugins['jupyter']
    config = jupyter.config
    self.assertEqual(jupyter.name, 'jupyter')
    self.assertEqual(config.get('plugin_type'), 'interactive_environment')
    user = model.User(email='blah@bler.blah', password='dockerDockerDOCKER')
    trans = galaxy_mock.MockTrans(user=user)
    jupyter.INTENV_REQUEST_FACTORY = (lambda t, p: 'mock')
    response = jupyter._render({}, trans=trans)
    response.strip()
    self.assertIsInstance(response, string_types)
    self.assertTrue(('-' in response))
    (ie_request, api_key) = response.split('-')
    self.assertEqual(ie_request, 'mock')
    match = re.match('[a-f0-9]{32}', api_key)
    self.assertIsNotNone(match)
    self.assertEqual(match.span(), (0, 32))
    mock_app_dir.remove()
