plone / Products.PlonePAS

User and group implementation for the Plone CMS and Zope PluggableAuthService
6 stars 21 forks source link

Fixed tests for cookie auth to also work with zope.interface 5.3.0. [master] #63

Closed mauritsvanrees closed 3 years ago

mauritsvanrees commented 3 years ago

This uses simpler representations for interfaces. Tests now pass with earlier and later versions.

Original error from Jenkins:

File "/home/jenkins/.buildout/eggs/cp36m/Products.PlonePAS-6.0.7-py3.6.egg/Products/PlonePAS/tests/cookie_auth.rst", line 55, in cookie_auth.rst
Failed example:
    for active, iface in actives:
        print(iface)
        for id, plugin in active:
            if id == 'credentials_cookie_auth':
               print(True)
Expected:
    <...IExtraction...>...True
    <...IChallenge...>...True
    <...ICredentialsUpdate...>...<...ICredentialsReset...>
Got:
    Products.PluggableAuthService.interfaces.plugins.IExtractionPlugin
    True
    Products.PluggableAuthService.interfaces.plugins.IChallengePlugin
    True
    Products.PluggableAuthService.interfaces.plugins.ICredentialsUpdatePlugin
    Products.PluggableAuthService.interfaces.plugins.ICredentialsResetPlugin

The fix is to print iface.__name__, which looks the same in all versions.

mister-roboto commented 3 years ago

@mauritsvanrees thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

mauritsvanrees commented 3 years ago

@jenkins-plone-org please run jobs