Skip to content

Commit

Permalink
Pyramid upgrade (conestack#11)
Browse files Browse the repository at this point in the history
* most of the tests run with pyramid 1.5

* move register_tile calls to cone.app.browser.includeme. All tests run again, import housekeeping in tests

* Pass ``name`` and ``path`` keyword arguments to ``register_tile`` and ``@tile`` all over the place.

* update coverage report

* some authoring tests

* Test several pyramid versions with this branch

* Do not use ``cone.tile.register_tile`` any more. Create dedicated tile classes and use ``cone.tile.tile`` all over the place.

* remove superfluous import

* Fix RST formatting

* include AjaxPath.overlay in test

* ignores

* auto checkout cone.tile untile merged in travis.cfg

* anon checkout URL for travis

* Transform model doctests to unittests WIP

* Transform model doctests to unittests WIP

* Transform model doctests to unittests WIP

* Transform model doctests to unittests WIP

* Transform model doctests to unittests WIP

* Transform model doctests to unittests WIP

* Transform model doctests to unittests done

* move original model doctests to docs/archive

* Transform app doctests to unittests done

* Transform security doctests to unittests WIP. Login function of security test layer optionally accepts password

* Transform security doctests to unittests WIP

* Transform security doctests to unittests WIP

* Transform security doctests to unittests done

* Transform utils doctests to unittests done

* Transform workflow doctests to unittests done

* Transform testing doctests to unittests done

* Transform browser __init__ doctests to unittests done

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests WIP

* Transform browser.actions doctests to unittests done

* move browser.actions doctest to docs/archive

* Use DummyVenusian from cone.tile.tests. Simplify authenticated context manager. Turn hook_tile_reg into context manager. Transform browser.ajax tests from doctests to unit tests WIP

* Use DummyVenusian from cone.tile.tests. Simplify authenticated context manager. Turn hook_tile_reg into context manager. Transform browser.ajax tests from doctests to unit tests WIP

* Transform browser.ajax tests from doctests to unit tests WIP

* Transform browser.ajax tests from doctests to unit tests WIP

* Transform browser.ajax tests from doctests to unit tests WIP

* Transform browser.ajax tests from doctests to unit tests WIP

* Transform browser.ajax tests from doctests to unit tests WIP

* Transform browser.ajax tests from doctests to unit tests done

* Transform browser.authoring tests from doctests to unit tests WIP

* Transform browser.authoring tests from doctests to unit tests WIP

* Transform browser.authoring tests from doctests to unit tests WIP

* Transform browser.authoring tests from doctests to unit tests WIP

* Transform browser.authoring tests from doctests to unit tests done

* mv archived doctests around

* Transform browser.batch doctests to unittests WIP

* Transform browser.batch doctests to unittests WIP

* Transform browser.batch doctests to unittests WIP

* Transform browser.batch doctests to unittests done

* Transform browser.contents doctests to unittests WIP

* Transform browser.contents doctests to unittests done

* Transform browser.contextmenu doctests to unittests done

* Transform browser.copysupport doctests to unittests done

* Transform browser.exception doctests to unittests done

* Transform browser.form doctests to unittests done

* Transform browser.layout doctests to unittests WIP

* Transform browser.layout doctests to unittests WIP

* Transform browser.layout doctests to unittests WIP

* Transform browser.layout doctests to unittests WIP

* Transform browser.layout doctests to unittests WIP

* Transform browser.layout doctests to unittests done

* Transform browser.login doctests to unittests done

* Transform browser.referencebrowser doctests to unittests WIP

* Transform browser.referencebrowser doctests to unittests WIP

* Transform browser.referencebrowser doctests to unittests done

* Transform browser.resources doctests to unittests done

* Transform browser.settings doctests to unittests done

* Transform browser.sharing doctests to unittests done

* Transform browser.table doctests to unittests done

* Transform browser.utils doctests to unittests done

* Transform browser.workflow doctests to unittests done

* Use authenticated contextmanager all over the place in tests

* make linter happy

* remove superfluous imports

* use tile decorator instead of register_tile

* minor cleanup

* Min version pyramid 1.5 now

* Tests run from pyramid 1.5 up to 1.9.4. pyramid 1.10.2 fails one test

* Update docs

* Add ``cone.app.main_hook`` decorator. ``cone.app.register_main_hook`` is deprecated and will be removed as of ``cone.app`` version 1.1.

* add tests for yafowil addon registration

* Add test for favicon_view

* Add test for case when tile rendered by ajax_tile raises exception

* Update overlay form docs

* Test overlay form

* Test overlay adding

* cleanup overlay form tests

* Overlay edit form tests

* Add cone.app.testing.reset_node_info_registry decorator. Add cone.app.browser.authoring.ContentForm tests. Add cone.app.model.node_info tests.

* Use node_info decorator in tests where appropriate

* Dedicated tests for AddFormHeading and EditFormHeading

* Rename some private properties in cone.app.browser.Batch. Test coverage of cone.app.browser.batch

* cone.app.browser.contents test coverage

* cone.app.browser.contextmenu test coverage

* Update coverage report

* Prevent ComponentLookupError in cone.app.browser.form.Form._process_form if controller.next returns HTTPFound instance. This never had any effect due to a redirect happening, we want to avoid the error anyway. cone.app.browser.form test coverage

* some more work on form tests

* ignore unreached import error in coverage

* mainmenu tests

* navtree tests

* layout tests

* referencebrowser tests

* minor fix in content form

* referencebrowser tests

* Referencebrowser test coverage. Change signature of referencebrowser yafowil widget callable attributes. Gets passed widget and data to match yafowil philosophy

* Browser resource tests

* Add content type header to merged js file

* browser resource test coverage

* use str.format() in browser settings

* Introduce cone.app.browser.sharing.GROUP_TITLE_ATTR and cone.app.browser.sharing.USER_TITLE_ATTR. sharing test coverage

* browser utils coverage

* browser workflow test coverage

* configure.zcml file in plugin is optional now. Test coverage

* Update coverage report
  • Loading branch information
rnixx authored Mar 24, 2019
1 parent 5171c7c commit efdd864
Show file tree
Hide file tree
Showing 106 changed files with 9,928 additions and 864 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@
/parts/
/dist/
/coverage/
/share/
/docs/Makefile
/docs/doctrees/
/docs/html/
/docs/make.bat
/docs/cone.app.zip
/docs/latex/
include/
/lib/
/local/
/pip-selfcheck.json
25 changes: 24 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,30 @@ Changes
1.0a13 (unreleased)
-------------------

- No changes yet.
- Minimum pyramid version is 1.5 now.

- Add ``cone.app.workflow.permission_checker`` for use with ``repoze.workflow``
to make it wirk with pyramid >= 1.8.
[rnix, 2019-03-21]

- Use ``request.has_permission`` instead of deprecated
``pyramid.security.has_permission``.
[rnix, 2019-03-21]

- Use ``request.authenticated_userid`` instead of deprecated
``pyramid.security.authenticated_userid``.
[rnix, 2019-03-21]

- Add ``cone.app.main_hook`` decorator. ``cone.app.register_main_hook`` is
deprecated and will be removed as of ``cone.app`` version 1.1.
[rnix, 2019-03-21]

- Convert doctests to unittests.
[rnix, 2019-03-21]

- Do not use ``cone.tile.register_tile`` any more. Create dedicated tile
classes and use ``cone.tile.tile`` all over the place.
[rnix, 2017-02-21]


1.0a12 (2018-11-20)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
License
=======

Copyright (c) 2009-2018, BlueDynamics Alliance, Austria
Copyright (c) 2009-2019, BlueDynamics Alliance, Austria
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
85 changes: 55 additions & 30 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The sources are in a GIT DVCS with its main branches at
Copyright
=========

- Copyright (c) 2009-2018 BlueDynamics Alliance http://www.bluedynamics.com
- Copyright (c) 2009-2019 BlueDynamics Alliance http://www.bluedynamics.com


Contributors
Expand All @@ -37,32 +37,57 @@ Test coverage
Summary of the test coverage report::

lines cov% module
199 100% cone.app.__init__
29 96% cone.app.browser.__init__
275 100% cone.app.browser.actions
175 98% cone.app.browser.ajax
242 95% cone.app.browser.authoring
101 100% cone.app.browser.batch
151 94% cone.app.browser.contents
72 94% cone.app.browser.contextmenu
111 100% cone.app.browser.copysupport
24 100% cone.app.browser.exception
87 90% cone.app.browser.form
280 90% cone.app.browser.layout
63 100% cone.app.browser.login
212 95% cone.app.browser.referencebrowser
73 79% cone.app.browser.resources
40 100% cone.app.browser.settings
149 98% cone.app.browser.sharing
140 100% cone.app.browser.table
81 98% cone.app.browser.utils
50 96% cone.app.browser.workflow
70 100% cone.app.interfaces
375 93% cone.app.model
178 100% cone.app.security
88 100% cone.app.testing.__init__
45 93% cone.app.testing.mock
44 100% cone.app.tests
47 100% cone.app.utils
63 100% cone.app.workflow
lines cov% module (path)
202 100% cone.app.__init__
42 100% cone.app.browser.__init__
293 100% cone.app.browser.actions
196 100% cone.app.browser.ajax
296 100% cone.app.browser.authoring
256 100% cone.app.browser.batch
175 100% cone.app.browser.contents
87 100% cone.app.browser.contextmenu
121 100% cone.app.browser.copysupport
39 100% cone.app.browser.exception
86 100% cone.app.browser.form
308 100% cone.app.browser.layout
87 100% cone.app.browser.login
248 100% cone.app.browser.referencebrowser
72 100% cone.app.browser.resources
49 100% cone.app.browser.settings
163 100% cone.app.browser.sharing
159 100% cone.app.browser.table
86 100% cone.app.browser.utils
54 100% cone.app.browser.workflow
75 100% cone.app.interfaces
406 100% cone.app.model
186 100% cone.app.security
122 100% cone.app.testing.__init__
63 100% cone.app.testing.mock
57 5% cone.app.tests.__init__
99 100% cone.app.tests.test_app
69 100% cone.app.tests.test_browser
397 100% cone.app.tests.test_browser_actions
340 100% cone.app.tests.test_browser_ajax
872 100% cone.app.tests.test_browser_authoring
550 100% cone.app.tests.test_browser_batch
263 100% cone.app.tests.test_browser_contents
96 100% cone.app.tests.test_browser_contextmenu
120 100% cone.app.tests.test_browser_copysupport
80 100% cone.app.tests.test_browser_exception
248 100% cone.app.tests.test_browser_form
346 100% cone.app.tests.test_browser_layout
43 100% cone.app.tests.test_browser_login
467 100% cone.app.tests.test_browser_referencebrowser
148 100% cone.app.tests.test_browser_resources
135 100% cone.app.tests.test_browser_settings
202 100% cone.app.tests.test_browser_sharing
172 100% cone.app.tests.test_browser_table
113 100% cone.app.tests.test_browser_utils
34 100% cone.app.tests.test_browser_workflow
461 100% cone.app.tests.test_model
299 100% cone.app.tests.test_security
39 100% cone.app.tests.test_testing
81 100% cone.app.tests.test_utils
69 100% cone.app.tests.test_workflow
54 100% cone.app.utils
71 100% cone.app.workflow
19 changes: 9 additions & 10 deletions TODO.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,22 @@ Roadmap
1.0 beta
--------

[ ] Test ``cone.app.browser.actions.DropdownAction`` with BS3.
[X] Migrate Doctests to Unittests where appropriate.

[ ] Python 3 support.

[ ] ``cone.app.browser.authoring.OverlayFormTile`` is superfluous.
[ ] Provide a ``form_action`` property on ``cone.app.browser.form.Form``
considering ``action_resource`` attribute. Consolidate with
``cone.app.browser.Form.YAMLForm.form_action``.

[ ] Test ``cone.app.browser.actions.DropdownAction`` with BS3.

[ ] Overhaul settings rendering. available settings should be rendered in
the navtree. ``SettingsBehavior`` for settings forms probably superfluous then.

[ ] Set ``ISecured`` on ``cone.app.workflow.WorkflowACL``

[ ] ``cone.app.browser.copysupport:124``: trigger ``contextchanged`` on
[ ] ``cone.app.browser.copysupport#124``: trigger ``contextchanged`` on
``#layout`` instead of ``.contextsensitiv``.

[ ] Get rid of remaining ``contextsensitiv`` CSS class related bdajax
Expand Down Expand Up @@ -93,10 +99,3 @@ security integration.

[ ] Rename ``cone.app.browser.batch.Batch`` to
``cone.app.browser.batch.Pagination`` provoding B/C.

1.2
---

[ ] Migrate Doctests to Unittests where appropriate.

[ ] Python 3 support.
21 changes: 11 additions & 10 deletions base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
parts =
test
coverage
pydev
sphinx

develop = .
Expand All @@ -16,10 +15,16 @@ include-site-packages = false
versions = versions

[versions]
zc.buildout =
setuptools =
pyramid = 1.1.3
pyramid-zcml = 0.9.2
zc.buildout =
setuptools =

# 1.5 - OK
# 1.6 - OK
# 1.7 - OK
# 1.8 - OK
# 1.9 - OK
# 1.10 - FAIL
pyramid = 1.9.4

[sources]
odict = git [email protected]:bluedynamics/odict.git
Expand All @@ -30,7 +35,7 @@ yafowil = git [email protected]:bluedynamics/yafowil.git
yafowil.yaml = git [email protected]:bluedynamics/yafowil.yaml.git
yafowil.webob = git [email protected]:bluedynamics/yafowil.webob.git
yafowil.bootstrap = git [email protected]:bluedynamics/yafowil.bootstrap.git
cone.tile = git [email protected]:bluedynamics/cone.tile.git
cone.tile = git [email protected]:bluedynamics/cone.tile.git branch=pyramid_upgrade
bdajax = git [email protected]:bluedynamics/bdajax.git

[testenv]
Expand Down Expand Up @@ -59,10 +64,6 @@ input = inline:
output = ${buildout:directory}/bin/coverage
mode = 755

[pydev]
recipe = pb.recipes.pydev
eggs = ${test:eggs}

[sphinx]
recipe = collective.recipe.sphinxbuilder
eggs =
Expand Down
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
rm -r ./lib ./include ./local ./bin
virtualenv --clear --no-site-packages .
./bin/pip install --upgrade pip setuptools zc.buildout
./bin/pip install --upgrade wheel pip setuptools zc.buildout
./bin/buildout -N
2 changes: 1 addition & 1 deletion cone.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
debug = true

[server:main]
use = egg:Paste#http
use = egg:waitress#main
host = 0.0.0.0
port = 8081

Expand Down
10 changes: 5 additions & 5 deletions src/cone/app/__init__.rst → docs/archive/__init__.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
cone main
---------

::
Imports::

>>> from cone.app import make_remote_addr_middleware
>>> from cone.app.model import BaseNode
>>> import cone.app
>>> import os

``get_root``::

>>> import os
>>> root = cone.app.get_root()
>>> root
<AppRoot object 'None' at ...>
Expand Down Expand Up @@ -38,7 +40,6 @@ Settings is displayed in navtree by default::

``register_plugin``::

>>> from cone.app.model import BaseNode
>>> cone.app.register_plugin('dummy', BaseNode)
>>> 'dummy' in root.factories.keys()
True
Expand Down Expand Up @@ -85,6 +86,7 @@ Settings is displayed in navtree by default::
... 'cone.auth_reissue_time': '300',
... 'cone.auth_max_age': '600',
... }

>>> cone.app.main({}, **settings)
Custom main hook called
<pyramid.router.Router object at ...>
Expand All @@ -95,8 +97,6 @@ Remove custom main hook after testing::

Remote address middleware::

>>> from cone.app import make_remote_addr_middleware

>>> class DummyApp(object):
... def __call__(self, environ, start_response):
... print environ['REMOTE_ADDR']
Expand Down
File renamed without changes.
Loading

0 comments on commit efdd864

Please sign in to comment.