Back to index

plone3  3.1.7
test_view.py
Go to the documentation of this file.
00001 import unittest
00002 from plone.app.openid.tests.base import OpenIdTestCase
00003 from Products.PluggableAuthService.interfaces.plugins \
00004         import IExtractionPlugin, ILoginPasswordExtractionPlugin
00005 
00006 class TestOpenIdView(OpenIdTestCase):
00007     def test_DefaultConfig(self):
00008         pas_info=self.pas_info
00009         self.assertEquals(pas_info.hasOpenIDdExtractor(), False)
00010         self.assertEquals(pas_info.hasLoginPasswordExtractor(), True)
00011 
00012     def test_OpenIdInstalled(self):
00013         self.portal.portal_quickinstaller.installProduct("plone.app.openid")
00014         pas_info=self.pas_info
00015         self.assertEquals(pas_info.hasOpenIDdExtractor(), True)
00016         self.assertEquals(pas_info.hasLoginPasswordExtractor(), True)
00017 
00018     def testOnlyOpenIdInstalled(self):
00019         plugins=self.pas.plugins.listPlugins(IExtractionPlugin)
00020         for (id, plugin) in plugins:
00021             if ILoginPasswordExtractionPlugin.providedBy(plugin):
00022                 plugin.manage_activateInterfaces(interfaces=())
00023         self.portal.portal_quickinstaller.installProduct("plone.app.openid")
00024 
00025         pas_info=self.pas_info
00026         self.assertEquals(pas_info.hasOpenIDdExtractor(), True)
00027         self.assertEquals(pas_info.hasLoginPasswordExtractor(), False)
00028 
00029 
00030 def test_suite():
00031     suite=unittest.TestSuite()
00032     suite.addTest(unittest.makeSuite(TestOpenIdView))
00033     return suite
00034