Beispiel #1
0
    def setUp(self):
        # create plugin
        from pas.plugins.authomatic.setuphandlers import _add_plugin

        self.aclu = self.layer["app"].acl_users
        _add_plugin(self.aclu, "authomatic")
        self.plugin = self.aclu["authomatic"]
    def test_removeplugin(self):
        # add before remove
        PLUGINID = 'authomatic'
        from pas.plugins.authomatic.setuphandlers import _add_plugin
        _add_plugin(self.aclu, pluginid=PLUGINID)
        self.assertIn(PLUGINID, self.aclu.objectIds())

        # now remove it
        from pas.plugins.authomatic.setuphandlers import _remove_plugin  # noqa
        _remove_plugin(self.aclu, pluginid=PLUGINID)
        self.assertNotIn(PLUGINID, self.aclu.objectIds())
    def test_addplugin(self):
        PLUGINID = 'authomatic'
        from pas.plugins.authomatic.setuphandlers import _add_plugin
        result = _add_plugin(self.aclu, pluginid=PLUGINID)
        self.assertIs(result, None)
        self.assertIn(PLUGINID, self.aclu.objectIds())

        from pas.plugins.authomatic.plugin import AuthomaticPlugin
        authomatic = self.aclu[PLUGINID]
        self.assertIsInstance(authomatic, AuthomaticPlugin)

        from pas.plugins.authomatic.setuphandlers import TITLE
        result = _add_plugin(self.aclu, pluginid=PLUGINID)
        self.assertEqual(result, TITLE + ' already installed.')
 def setUp(self):
     # create plugin
     from pas.plugins.authomatic.setuphandlers import _add_plugin
     self.aclu = self.layer['app'].acl_users
     _add_plugin(self.aclu, 'authomatic')
     self.plugin = self.aclu['authomatic']
Beispiel #5
0
 def setUp(self):
     # create plugin
     from pas.plugins.authomatic.setuphandlers import _add_plugin
     self.aclu = self.layer['app'].acl_users
     _add_plugin(self.aclu, 'authomatic')
     self.plugin = self.aclu['authomatic']