Esempio n. 1
0
 def testCreateForms(self):
     # Verify the factory creates the login forms.
     if CookieCrumbler.__module__.find('CMFCore') >= 0:
         # This test is disabled in CMFCore.
         return
     self.root._delObject('cookie_authentication')
     manage_addCC(self.root, 'login', create_forms=1)
     ids = self.root.login.objectIds()
     ids.sort()
     self.assertEqual(
         tuple(ids), ('index_html', 'logged_in', 'logged_out', 'login_form',
                      'standard_login_footer', 'standard_login_header'))
Esempio n. 2
0
 def testCreateForms(self):
     # Verify the factory creates the login forms.
     if CookieCrumbler.__module__.find('CMFCore') >= 0:
         # This test is disabled in CMFCore.
         return
     self.root._delObject('cookie_authentication')
     manage_addCC(self.root, 'login', create_forms=1)
     ids = self.root.login.objectIds()
     ids.sort()
     self.assertEqual(tuple(ids), (
         'index_html', 'logged_in', 'logged_out', 'login_form',
         'standard_login_footer', 'standard_login_header'))
Esempio n. 3
0
def manage_addCookieCrumblingPlugin(self, id, title='', RESPONSE=None, **kw):
    """
    Create an instance of a cookie crumbling plugin.
    """
    self = self.this()

    o = CookieCrumblingPlugin(id, title, **kw)
    self._setObject(o.getId(), o)
    o = getattr(aq_base(self), id)

    manage_addCC(o, CC_ID)

    if RESPONSE is not None:
        RESPONSE.redirect('manage_workspace')
Esempio n. 4
0
def manage_addCookieCrumblingPlugin(self, id, title='',
                                    RESPONSE=None, **kw):
    """
    Create an instance of a cookie crumbling plugin.
    """
    self = self.this()

    o = CookieCrumblingPlugin(id, title, **kw)
    self._setObject(o.getId(), o)
    o = getattr(aq_base(self), id)

    manage_addCC(o, CC_ID)

    if RESPONSE is not None:
        RESPONSE.redirect('manage_workspace')
Esempio n. 5
0
    def testCreateForms(self):
        # Verify the factory creates the login forms.
        from Products.CMFCore.CookieCrumbler  import manage_addCC

        if 'CMFCore' in self._getTargetClass().__module__:
            # This test is disabled in CMFCore.
            return

        root, cc, req, credentials = self._makeSite()
        root._delObject('cookie_authentication')
        manage_addCC(root, 'login', create_forms=1)
        ids = root.login.objectIds()
        ids.sort()
        self.assertEqual(tuple(ids), (
            'index_html', 'logged_in', 'logged_out', 'login_form',
            'standard_login_footer', 'standard_login_header'))
Esempio n. 6
0
    def testCreateForms(self):
        # Verify the factory creates the login forms.
        from Products.CMFCore.CookieCrumbler import manage_addCC

        if 'CMFCore' in self._getTargetClass().__module__:
            # This test is disabled in CMFCore.
            return

        root, cc, req, credentials = self._makeSite()
        root._delObject('cookie_authentication')
        manage_addCC(root, 'login', create_forms=1)
        ids = root.login.objectIds()
        ids.sort()
        self.assertEqual(
            tuple(ids), ('index_html', 'logged_in', 'logged_out', 'login_form',
                         'standard_login_footer', 'standard_login_header'))