Skip to content

Commit

Permalink
[fc] Repository: Products.PlonePAS
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2021-07-01T16:46:02+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: plone/Products.PlonePAS@b4df71e

Fixed tests for cookie auth to also work with zope.interface 5.3.0.

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

Original error from [Jenkins](https://jenkins.plone.org/job/pull-request-5.2-3.6/1938/testReport/junit/Products.PlonePAS/tests/cookie_auth_rst/):

```
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:
    &lt;...IExtraction...&gt;...True
    &lt;...IChallenge...&gt;...True
    &lt;...ICredentialsUpdate...&gt;...&lt;...ICredentialsReset...&gt;
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.

Files changed:
A news/237.bugfix
M src/Products/PlonePAS/tests/cookie_auth.rst
Repository: Products.PlonePAS

Branch: refs/heads/master
Date: 2021-07-02T08:50:41+02:00
Author: Jens W. Klein (jensens) <[email protected]>
Commit: plone/Products.PlonePAS@4390f6f

Merge pull request #63 from plone/maurits/fix-interface-repr-tests-master

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

Files changed:
A news/237.bugfix
M src/Products/PlonePAS/tests/cookie_auth.rst
  • Loading branch information
jensens committed Jul 2, 2021
1 parent 0e4a81c commit 445564a
Showing 1 changed file with 47 additions and 17 deletions.
64 changes: 47 additions & 17 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,62 @@
Repository: plone.restapi
Repository: Products.PlonePAS


Branch: refs/heads/master
Date: 2021-07-02T06:09:39+02:00
Author: Timo Stollenwerk (tisto) <[email protected]>
Commit: https://github.com/plone/plone.restapi/commit/cb6382a8c040a81b038a1ce6adcc233d2794e8d3

Preparing release 8.3.1
Date: 2021-07-01T16:46:02+02:00
Author: Maurits van Rees (mauritsvanrees) <[email protected]>
Commit: https://github.com/plone/Products.PlonePAS/commit/b4df71ec77f5cadf406b9b1374fa990688f52831

Fixed tests for cookie auth to also work with zope.interface 5.3.0.

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

Original error from [Jenkins](https://jenkins.plone.org/job/pull-request-5.2-3.6/1938/testReport/junit/Products.PlonePAS/tests/cookie_auth_rst/):

```
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:
&lt;...IExtraction...&gt;...True
&lt;...IChallenge...&gt;...True
&lt;...ICredentialsUpdate...&gt;...&lt;...ICredentialsReset...&gt;
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.

Files changed:
M CHANGES.rst
M setup.py
D news/1141.bugfix
A news/237.bugfix
M src/Products/PlonePAS/tests/cookie_auth.rst

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 918d9f909..370722c8a 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -8,6 +8,15 @@ Changelog\n \n .. towncrier release notes start\n \n+8.3.1 (2021-07-02)\n+------------------\n+\n+Bug fixes:\n+\n+\n+- Unify ZMI, HTML form, and API login. @rpatterson (#1141)\n+\n+\n 8.3.0 (2021-06-07)\n ------------------\n \ndiff --git a/news/1141.bugfix b/news/1141.bugfix\ndeleted file mode 100644\nindex e57f5d41e..000000000\n--- a/news/1141.bugfix\n+++ /dev/null\n@@ -1 +0,0 @@\n-Unify ZMI, HTML form, and API login. @rpatterson\n\\ No newline at end of file\ndiff --git a/setup.py b/setup.py\nindex 78c6fbec8..e12974317 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -1,7 +1,7 @@\n from setuptools import setup, find_packages\n import sys\n \n-version = "8.3.1.dev0"\n+version = "8.3.1"\n \n assert sys.version_info >= (3, 6, 0), "plone.restapi 8 requires Python 3.6.0+. Please downgrade to plone.restapi 7 for Python 2 and Plone 4.3/5.1."\n \n'
b"diff --git a/news/237.bugfix b/news/237.bugfix\nnew file mode 100644\nindex 00000000..41512c2e\n--- /dev/null\n+++ b/news/237.bugfix\n@@ -0,0 +1,4 @@\n+Fixed tests for cookie auth to also work with `zope.interface` 5.3.0.\n+This uses simpler representations for interfaces.\n+Tests now pass with earlier and later versions.\n+[maurits]\ndiff --git a/src/Products/PlonePAS/tests/cookie_auth.rst b/src/Products/PlonePAS/tests/cookie_auth.rst\nindex fb92ceee..21b3b2f6 100644\n--- a/src/Products/PlonePAS/tests/cookie_auth.rst\n+++ b/src/Products/PlonePAS/tests/cookie_auth.rst\n@@ -53,13 +53,16 @@ Make sure cookie plugin is installed and activated.\n ... pass\n \n >>> for active, iface in actives:\n- ... print(iface)\n+ ... print(iface.__name__)\n ... for id, plugin in active:\n ... if id == 'credentials_cookie_auth':\n ... print(True)\n- <...IExtraction...>...True\n- <...IChallenge...>...True\n- <...ICredentialsUpdate...>...<...ICredentialsReset...>\n+ IExtractionPlugin\n+ True\n+ IChallengePlugin\n+ True\n+ ICredentialsUpdatePlugin\n+ ICredentialsResetPlugin\n \n User in parent folder\n ---------------------\n"

Repository: plone.restapi
Repository: Products.PlonePAS


Branch: refs/heads/master
Date: 2021-07-02T06:10:01+02:00
Author: Timo Stollenwerk (tisto) <[email protected]>
Commit: https://github.com/plone/plone.restapi/commit/24e896e42b0a231db9e1b0748aba04f0f0e855f4
Date: 2021-07-02T08:50:41+02:00
Author: Jens W. Klein (jensens) <[email protected]>
Commit: https://github.com/plone/Products.PlonePAS/commit/4390f6fd1f6fe7365479c7d55a6492edafe09066

Merge pull request #63 from plone/maurits/fix-interface-repr-tests-master

Back to development: 8.3.2
Fixed tests for cookie auth to also work with zope.interface 5.3.0. [master]

Files changed:
M setup.py
A news/237.bugfix
M src/Products/PlonePAS/tests/cookie_auth.rst

b'diff --git a/setup.py b/setup.py\nindex e12974317..eba75a489 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -1,7 +1,7 @@\n from setuptools import setup, find_packages\n import sys\n \n-version = "8.3.1"\n+version = "8.3.2.dev0"\n \n assert sys.version_info >= (3, 6, 0), "plone.restapi 8 requires Python 3.6.0+. Please downgrade to plone.restapi 7 for Python 2 and Plone 4.3/5.1."\n \n'
b"diff --git a/news/237.bugfix b/news/237.bugfix\nnew file mode 100644\nindex 00000000..41512c2e\n--- /dev/null\n+++ b/news/237.bugfix\n@@ -0,0 +1,4 @@\n+Fixed tests for cookie auth to also work with `zope.interface` 5.3.0.\n+This uses simpler representations for interfaces.\n+Tests now pass with earlier and later versions.\n+[maurits]\ndiff --git a/src/Products/PlonePAS/tests/cookie_auth.rst b/src/Products/PlonePAS/tests/cookie_auth.rst\nindex fb92ceee..21b3b2f6 100644\n--- a/src/Products/PlonePAS/tests/cookie_auth.rst\n+++ b/src/Products/PlonePAS/tests/cookie_auth.rst\n@@ -53,13 +53,16 @@ Make sure cookie plugin is installed and activated.\n ... pass\n \n >>> for active, iface in actives:\n- ... print(iface)\n+ ... print(iface.__name__)\n ... for id, plugin in active:\n ... if id == 'credentials_cookie_auth':\n ... print(True)\n- <...IExtraction...>...True\n- <...IChallenge...>...True\n- <...ICredentialsUpdate...>...<...ICredentialsReset...>\n+ IExtractionPlugin\n+ True\n+ IChallengePlugin\n+ True\n+ ICredentialsUpdatePlugin\n+ ICredentialsResetPlugin\n \n User in parent folder\n ---------------------\n"

0 comments on commit 445564a

Please sign in to comment.