-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from plone/revert-5-tomgross-removeunusedcode
Revert "Remove unused tesing code with dependency to PloneTestCase"
- Loading branch information
Showing
5 changed files
with
49 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
import pkg_resources | ||
|
||
try: | ||
pkg_resources.get_distribution('openid.yadis') | ||
except pkg_resources.DistributionNotFound: | ||
HAS_OPENID = False | ||
else: | ||
HAS_OPENID = True | ||
from openid.yadis import etxrd | ||
HAS_OPENID=True | ||
except: | ||
HAS_OPENID=False | ||
|
||
import socket | ||
HAS_SSL = hasattr(socket, "ssl") | ||
HAS_SSL=hasattr(socket, "ssl") | ||
del socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from Products.PloneTestCase.layer import ZCML | ||
|
||
PloneOpenId = ZCML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
from Testing import ZopeTestCase | ||
from plone.session.tests.sessioncase import PloneSessionTestCase | ||
from Testing.ZopeTestCase.placeless import setUp, tearDown | ||
from Testing.ZopeTestCase.placeless import zcml | ||
|
||
from plone.openid.plugins.oid import OpenIdPlugin | ||
from plone.openid.tests.consumer import PatchPlugin | ||
from plone.openid.tests.layer import PloneOpenId | ||
|
||
# Use a mock consumer for the OpenId plugin | ||
PatchPlugin(OpenIdPlugin) | ||
|
||
class OpenIdTestCase(PloneSessionTestCase): | ||
|
||
layer = PloneOpenId | ||
|
||
identity = "http://plone.myopenid.com" | ||
server_response={ | ||
"openid.mode" : "id_res", | ||
"nonce" : "nonce", | ||
"openid.identity" : "http://plone.myopenid.com", | ||
"openid.assoc_handle" : "assoc_handle", | ||
"openid.return_to" : "return_to", | ||
"openid.signed" : "signed", | ||
"openid.sig" : "sig", | ||
"openid.invalidate_handle" : "invalidate_handle", | ||
} | ||
|
||
def afterSetUp(self): | ||
PloneSessionTestCase.afterSetUp(self) | ||
self.app.folder = self.folder | ||
|
||
if self.folder.pas.hasObject("openid"): | ||
self.app.folder.pas._delObject("openid") | ||
|
||
self.app.folder.pas._setObject("openid", OpenIdPlugin("openid")) | ||
|
||
class FunctionalOpenIdTestCase(ZopeTestCase.Functional, OpenIdTestCase): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters