Back to index

plone3  3.1.7
oitestcase.py
Go to the documentation of this file.
00001 from Testing import ZopeTestCase
00002 from plone.session.tests.sessioncase import PloneSessionTestCase
00003 from Testing.ZopeTestCase.placeless import setUp, tearDown
00004 from Testing.ZopeTestCase.placeless import zcml
00005 
00006 from plone.openid.plugins.oid import OpenIdPlugin
00007 from plone.openid.tests.consumer import PatchPlugin
00008 from plone.openid.tests.layer import PloneOpenId
00009 
00010 # Use a mock consumer for the OpenId plugin
00011 PatchPlugin(OpenIdPlugin)
00012 
00013 class OpenIdTestCase(PloneSessionTestCase):
00014 
00015     layer = PloneOpenId
00016 
00017     identity = "http://plone.myopenid.com"
00018     server_response={
00019             "openid.mode"              : "id_res",
00020             "nonce"                    : "nonce",
00021             "openid.identity"          : "http://plone.myopenid.com",
00022             "openid.assoc_handle"      : "assoc_handle",
00023             "openid.return_to"         : "return_to",
00024             "openid.signed"            : "signed",
00025             "openid.sig"               : "sig",
00026             "openid.invalidate_handle" : "invalidate_handle",
00027             }
00028 
00029     def afterSetUp(self):
00030         PloneSessionTestCase.afterSetUp(self)
00031         self.app.folder = self.folder
00032 
00033         if self.folder.pas.hasObject("openid"):
00034             self.app.folder.pas._delObject("openid")
00035 
00036         self.app.folder.pas._setObject("openid", OpenIdPlugin("openid"))
00037 
00038 class FunctionalOpenIdTestCase(ZopeTestCase.Functional, OpenIdTestCase):
00039     pass