Skip to content

Commit

Permalink
Merge pull request #6 from plone/revert-5-tomgross-removeunusedcode
Browse files Browse the repository at this point in the history
Revert "Remove unused tesing code with dependency to PloneTestCase"
  • Loading branch information
tomgross committed Dec 10, 2014
2 parents 89e5ccb + 7a64c29 commit 7ba89e9
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 13 deletions.
3 changes: 1 addition & 2 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Changelog
2.0.3 (unreleased)
------------------

- Removed unused testing code with dependency to PloneTestCase
[tomgross]
- Nothing changed yet.


2.0.2 (2013-12-07)
Expand Down
13 changes: 5 additions & 8 deletions plone/openid/config.py
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
3 changes: 3 additions & 0 deletions plone/openid/tests/layer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from Products.PloneTestCase.layer import ZCML

PloneOpenId = ZCML
39 changes: 39 additions & 0 deletions plone/openid/tests/oitestcase.py
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
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@
classifiers=[
"Environment :: Web Environment",
"Framework :: Plone",
"Framework :: Plone :: 5.0",
"Framework :: Zope2",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Topic :: System :: Systems Administration :: Authentication/Directory",
],
keywords='PAS openid authentication',
author='Plone Foundation',
author_email='plone-developers@lists.sourceforge.net',
url='https://github.com/plone/plone.openid',
url='http://svn.plone.org/svn/plone/plone.openid',
license='BSD',
packages=find_packages(exclude=['ez_setup']),
namespace_packages=['plone'],
Expand Down

0 comments on commit 7ba89e9

Please sign in to comment.