Skip to content

Commit

Permalink
[fc] Repository: plone.app.layout
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2018-09-04T16:32:11+02:00
Author: Mikel Larreategi (erral) <mlarreategi@codesyntax.com>
Commit: plone/plone.app.layout@1164829

Failing tests showing that the byline is hidden for logged-in users

Files changed:
M plone/app/layout/viewlets/tests/test_content.py
Repository: plone.app.layout

Branch: refs/heads/master
Date: 2018-09-04T16:32:11+02:00
Author: Mikel Larreategi (erral) <mlarreategi@codesyntax.com>
Commit: plone/plone.app.layout@b3bb2bf

show byline for logged in users

test

Files changed:
M plone/app/layout/viewlets/content.py
M plone/app/layout/viewlets/tests/test_content.py
Repository: plone.app.layout

Branch: refs/heads/master
Date: 2018-09-04T16:33:20+02:00
Author: Mikel Larreategi (erral) <mlarreategi@codesyntax.com>
Commit: plone/plone.app.layout@60f3180

changelog

Files changed:
M CHANGES.rst
Repository: plone.app.layout

Branch: refs/heads/master
Date: 2018-09-06T10:00:00+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: plone/plone.app.layout@18b0c8e

Merge pull request #161 from plone/erral-issue-160-document-byline

Fix document byline for logged-in users

Files changed:
M CHANGES.rst
M plone/app/layout/viewlets/content.py
M plone/app/layout/viewlets/tests/test_content.py
  • Loading branch information
jensens committed Sep 6, 2018
1 parent 9676da2 commit 609d27a
Showing 1 changed file with 50 additions and 17 deletions.
67 changes: 50 additions & 17 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,67 @@
Repository: plone.restapi
Repository: plone.app.layout


Branch: refs/heads/master
Date: 2018-09-05T15:34:24+02:00
Author: Sune Broendum Woeller (sunew) <sune@woeller.dk>
Commit: https://github.com/plone/plone.restapi/commit/dfd8a27ec7f7a7669cad3326595f97dbfcf49b7c
Date: 2018-09-04T16:32:11+02:00
Author: Mikel Larreategi (erral) <mlarreategi@codesyntax.com>
Commit: https://github.com/plone/plone.app.layout/commit/1164829bf8b7c15c1b6dff6b7d0e98c46f38bea1

document generating the documentation snippets
Failing tests showing that the byline is hidden for logged-in users

Files changed:
A docs/source/contributing.rst
M docs/source/index.rst
M plone/app/layout/viewlets/tests/test_content.py

b'diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst\nnew file mode 100644\nindex 00000000..3634e68b\n--- /dev/null\n+++ b/docs/source/contributing.rst\n@@ -0,0 +1,28 @@\n+Contributing to plone.restapi\n+=============================\n+\n+Generating documentation examples\n+---------------------------------\n+\n+This documentation includes examples of requests and responses (http, curl, httpie and python-requests).\n+These examples are generated by the documentation tests in ``test_documentation.py``.\n+To generate a new example, add a new test case to `test_documentation.py` - for example ``test_documentation_search_fullobjects``, and run the test:\n+\n+``./bin/test -t test_documentation_search_fullobjects``\n+\n+This generates the request and the response files in ``tests/http-examples/``.\n+\n+Include them in the documentation like this:\n+\n+.. code-block:: ReST\n+\n+ .. http:example:: curl httpie python-requests\n+ :request: ../../src/plone/restapi/tests/http-examples/search_fullobjects.req\n+\n+ .. literalinclude:: ../../src/plone/restapi/tests/http-examples/search_fullobjects.resp\n+ :language: http\n+\n+\n+Build the sphinx docs locally to test the rendering by running ``make html`` in the docs folder.\n+\n+Make sure you add and commit the generated files in ``http-examples``.\ndiff --git a/docs/source/index.rst b/docs/source/index.rst\nindex 6cca136e..882b2765 100644\n--- a/docs/source/index.rst\n+++ b/docs/source/index.rst\n@@ -53,6 +53,7 @@ Contents\n i18n\n email-notification\n upgrade-guide\n+ contributing\n \n .. include:: ../../README.rst\n \n'
b'diff --git a/plone/app/layout/viewlets/tests/test_content.py b/plone/app/layout/viewlets/tests/test_content.py\nindex 6fe448a..446802b 100644\n--- a/plone/app/layout/viewlets/tests/test_content.py\n+++ b/plone/app/layout/viewlets/tests/test_content.py\n@@ -78,6 +78,33 @@ def test_pub_date(self):\n self.assertEqual(viewlet.pub_date(), None)\n \n \n+ def test_anonymous_users_see_byline_if_show_enabled(self):\n+ self.security_settings.allow_anon_views_about = True\n+ self.logout()\n+ viewlet = self._get_viewlet()\n+ self.assertTrue(viewlet.show())\n+\n+ def test_anonymous_users_dont_see_byline_if_show_disabled(self):\n+ self.security_settings.allow_anon_views_about = False\n+ self.logout()\n+ viewlet = self._get_viewlet()\n+ self.assertFalse(viewlet.show())\n+\n+ def test_logged_users_see_byline_if_show_enabled(self):\n+ self.security_settings.allow_anon_views_about = True\n+ #self.logout()\n+ viewlet = self._get_viewlet()\n+ self.assertTrue(viewlet.show())\n+\n+ def test_logged_users_see_byline_if_show_disabled(self):\n+ self.security_settings.allow_anon_views_about = False\n+ #self.logout()\n+ viewlet = self._get_viewlet()\n+ self.assertTrue(viewlet.show())\n+\n+\n+\n+\n class TestHistoryBylineViewletView(ViewletsTestCase):\n """\n Test the document by line viewlet\n'

Repository: plone.restapi
Repository: plone.app.layout


Branch: refs/heads/master
Date: 2018-09-06T09:32:59+02:00
Author: Sune Broendum Woeller (sunew) <sune@woeller.dk>
Commit: https://github.com/plone/plone.restapi/commit/eb21521bedad96e652295732bd6cf41610d8d340
Date: 2018-09-04T16:32:11+02:00
Author: Mikel Larreategi (erral) <mlarreategi@codesyntax.com>
Commit: https://github.com/plone/plone.app.layout/commit/b3bb2bfc9d2c8d06b3803e19f87e87b63e5a4ed3

Merge pull request #614 from plone/contributing-docs
show byline for logged in users

document generating the documentation snippets
test

Files changed:
A docs/source/contributing.rst
M docs/source/index.rst
M plone/app/layout/viewlets/content.py
M plone/app/layout/viewlets/tests/test_content.py

b'diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst\nnew file mode 100644\nindex 00000000..3634e68b\n--- /dev/null\n+++ b/docs/source/contributing.rst\n@@ -0,0 +1,28 @@\n+Contributing to plone.restapi\n+=============================\n+\n+Generating documentation examples\n+---------------------------------\n+\n+This documentation includes examples of requests and responses (http, curl, httpie and python-requests).\n+These examples are generated by the documentation tests in ``test_documentation.py``.\n+To generate a new example, add a new test case to `test_documentation.py` - for example ``test_documentation_search_fullobjects``, and run the test:\n+\n+``./bin/test -t test_documentation_search_fullobjects``\n+\n+This generates the request and the response files in ``tests/http-examples/``.\n+\n+Include them in the documentation like this:\n+\n+.. code-block:: ReST\n+\n+ .. http:example:: curl httpie python-requests\n+ :request: ../../src/plone/restapi/tests/http-examples/search_fullobjects.req\n+\n+ .. literalinclude:: ../../src/plone/restapi/tests/http-examples/search_fullobjects.resp\n+ :language: http\n+\n+\n+Build the sphinx docs locally to test the rendering by running ``make html`` in the docs folder.\n+\n+Make sure you add and commit the generated files in ``http-examples``.\ndiff --git a/docs/source/index.rst b/docs/source/index.rst\nindex 6cca136e..882b2765 100644\n--- a/docs/source/index.rst\n+++ b/docs/source/index.rst\n@@ -53,6 +53,7 @@ Contents\n i18n\n email-notification\n upgrade-guide\n+ contributing\n \n .. include:: ../../README.rst\n \n'
b"diff --git a/plone/app/layout/viewlets/content.py b/plone/app/layout/viewlets/content.py\nindex 07e262d..9651ab2 100644\n--- a/plone/app/layout/viewlets/content.py\n+++ b/plone/app/layout/viewlets/content.py\n@@ -72,7 +72,7 @@ def show(self):\n ISecuritySchema,\n prefix='plone',\n )\n- return self.anonymous and settings.allow_anon_views_about\n+ return not self.anonymous or settings.allow_anon_views_about\n \n def creator(self):\n return self.context.Creator()\ndiff --git a/plone/app/layout/viewlets/tests/test_content.py b/plone/app/layout/viewlets/tests/test_content.py\nindex 446802b..b8914c4 100644\n--- a/plone/app/layout/viewlets/tests/test_content.py\n+++ b/plone/app/layout/viewlets/tests/test_content.py\n@@ -92,13 +92,11 @@ def test_anonymous_users_dont_see_byline_if_show_disabled(self):\n \n def test_logged_users_see_byline_if_show_enabled(self):\n self.security_settings.allow_anon_views_about = True\n- #self.logout()\n viewlet = self._get_viewlet()\n self.assertTrue(viewlet.show())\n \n def test_logged_users_see_byline_if_show_disabled(self):\n self.security_settings.allow_anon_views_about = False\n- #self.logout()\n viewlet = self._get_viewlet()\n self.assertTrue(viewlet.show())\n \n"

Repository: plone.app.layout


Branch: refs/heads/master
Date: 2018-09-04T16:33:20+02:00
Author: Mikel Larreategi (erral) <mlarreategi@codesyntax.com>
Commit: https://github.com/plone/plone.app.layout/commit/60f3180365f0f2bc14960f87e676466b45494eb9

changelog

Files changed:
M CHANGES.rst

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 32873bb..e6d26c5 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -15,10 +15,14 @@ New features:\n \n Bug fixes:\n \n+- Show document byline for logged-in users. Fixes #160\n+ [erral]\n+\n - Get rid of obsolete ``X-UA-Compatible`` header.\n [hvelarde]\n \n \n+\n 2.8.1 (2018-06-18)\n ------------------\n \n'

Repository: plone.app.layout


Branch: refs/heads/master
Date: 2018-09-06T10:00:00+02:00
Author: Jens W. Klein (jensens) <jk@kleinundpartner.at>
Commit: https://github.com/plone/plone.app.layout/commit/18b0c8e671c0093c663dffbe9e5784a5ced016d4

Merge pull request #161 from plone/erral-issue-160-document-byline

Fix document byline for logged-in users

Files changed:
M CHANGES.rst
M plone/app/layout/viewlets/content.py
M plone/app/layout/viewlets/tests/test_content.py

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 32873bb..e6d26c5 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -15,10 +15,14 @@ New features:\n \n Bug fixes:\n \n+- Show document byline for logged-in users. Fixes #160\n+ [erral]\n+\n - Get rid of obsolete ``X-UA-Compatible`` header.\n [hvelarde]\n \n \n+\n 2.8.1 (2018-06-18)\n ------------------\n \ndiff --git a/plone/app/layout/viewlets/content.py b/plone/app/layout/viewlets/content.py\nindex 07e262d..9651ab2 100644\n--- a/plone/app/layout/viewlets/content.py\n+++ b/plone/app/layout/viewlets/content.py\n@@ -72,7 +72,7 @@ def show(self):\n ISecuritySchema,\n prefix=\'plone\',\n )\n- return self.anonymous and settings.allow_anon_views_about\n+ return not self.anonymous or settings.allow_anon_views_about\n \n def creator(self):\n return self.context.Creator()\ndiff --git a/plone/app/layout/viewlets/tests/test_content.py b/plone/app/layout/viewlets/tests/test_content.py\nindex 6fe448a..b8914c4 100644\n--- a/plone/app/layout/viewlets/tests/test_content.py\n+++ b/plone/app/layout/viewlets/tests/test_content.py\n@@ -78,6 +78,31 @@ def test_pub_date(self):\n self.assertEqual(viewlet.pub_date(), None)\n \n \n+ def test_anonymous_users_see_byline_if_show_enabled(self):\n+ self.security_settings.allow_anon_views_about = True\n+ self.logout()\n+ viewlet = self._get_viewlet()\n+ self.assertTrue(viewlet.show())\n+\n+ def test_anonymous_users_dont_see_byline_if_show_disabled(self):\n+ self.security_settings.allow_anon_views_about = False\n+ self.logout()\n+ viewlet = self._get_viewlet()\n+ self.assertFalse(viewlet.show())\n+\n+ def test_logged_users_see_byline_if_show_enabled(self):\n+ self.security_settings.allow_anon_views_about = True\n+ viewlet = self._get_viewlet()\n+ self.assertTrue(viewlet.show())\n+\n+ def test_logged_users_see_byline_if_show_disabled(self):\n+ self.security_settings.allow_anon_views_about = False\n+ viewlet = self._get_viewlet()\n+ self.assertTrue(viewlet.show())\n+\n+\n+\n+\n class TestHistoryBylineViewletView(ViewletsTestCase):\n """\n Test the document by line viewlet\n'

0 comments on commit 609d27a

Please sign in to comment.