From 5157b14655d7ff2b3780715ea38217125dd93003 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 27 Dec 2019 21:26:19 -0800 Subject: Update docs/tutorials/wiki/installation.rst and related files --- docs/tutorials/wiki/installation.rst | 55 +++++++++++----------- .../src/installation/tutorial/templates/layout.pt | 2 +- .../wiki/src/installation/tutorial/tests.py | 6 +++ .../src/installation/tutorial/views/default.py | 2 +- .../src/installation/tutorial/views/notfound.py | 2 +- 5 files changed, 37 insertions(+), 30 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index cfa021540..7c21ec02c 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -185,18 +185,20 @@ The console will show ``pip`` checking for packages and installing missing packa .. code-block:: bash - Successfully installed BTrees-4.5.1 Chameleon-3.5 Mako-1.0.7 \ - MarkupSafe-1.1.0 PasteDeploy-1.5.2 Pygments-2.2.0 WebTest-2.0.32 \ - ZConfig-3.3.0 ZEO-5.2.0 ZODB-5.5.1 ZODB3-3.11.0 atomicwrites-1.2.1 \ - attrs-18.2.0 beautifulsoup4-4.6.3 coverage-4.5.2 hupper-1.4.1 \ - more-itertools-4.3.0 persistent-4.4.3 plaster-1.0 plaster-pastedeploy-0.6 \ - pluggy-0.8.0 py-1.7.0 pyramid-1.10.1 pyramid-chameleon-0.3 \ - pyramid-debugtoolbar-4.5 pyramid-mako-1.0.2 pyramid-retry-1.0 \ - pyramid-tm-2.2.1 pyramid-zodbconn-0.8.1 pytest-4.0.0 pytest-cov-2.6.0 \ - repoze.lru-0.7 six-1.11.0 transaction-2.4.0 translationstring-1.3 \ - tutorial venusian-1.1.0 waitress-1.1.0 webob-1.8.4 zc.lockfile-1.4 \ - zdaemon-4.3 zodbpickle-1.0.2 zodburi-2.3.0 zope.deprecation-4.3.0 \ - zope.interface-4.6.0 + Successfully installed BTrees-4.6.1 Chameleon-3.6.2 Mako-1.1.0 \ + MarkupSafe-1.1.1 PasteDeploy-2.0.1 Pygments-2.5.2 WebTest-2.0.33 \ + ZConfig-3.5.0 ZEO-5.2.1 ZODB-5.5.1 ZODB3-3.11.0 attrs-19.3.0 \ + beautifulsoup4-4.8.2 cffi-1.13.2 coverage-5.0.1 hupper-1.9.1 \ + importlib-metadata-1.3.0 more-itertools-8.0.2 packaging-19.2 \ + persistent-4.5.1 plaster-1.0 plaster-pastedeploy-0.7 pluggy-0.13.1 \ + py-1.8.1 pycparser-2.19 pyparsing-2.4.6 pyramid-1.10.4 \ + pyramid-chameleon-0.3 pyramid-debugtoolbar-4.5.1 pyramid-mako-1.1.0 \ + pyramid-retry-2.1 pyramid-tm-2.3 pyramid-zodbconn-0.8.1 pytest-5.3.2 \ + pytest-cov-2.8.1 repoze.lru-0.7 six-1.13.0 soupsieve-1.9.5 \ + transaction-3.0.0 translationstring-1.3 tutorial venusian-3.0.0 \ + waitress-1.4.1 wcwidth-0.1.7 webob-1.8.5 zc.lockfile-2.0 zdaemon-4.3 \ + zipp-0.6.0 zodbpickle-2.0.0 zodburi-2.4.0 zope.deprecation-4.4.0 \ + zope.interface-4.7.1 Testing requirements are defined in our project's ``setup.py`` file, in the ``tests_require`` and ``extras_require`` stanzas. @@ -241,8 +243,8 @@ For a successful test run, you should see output that ends like this: .. code-block:: bash - . - 1 passed in 0.24 seconds + .. + 2 passed in 0.49 seconds Expose test coverage information @@ -274,29 +276,28 @@ If successful, you will see output something like this: .. code-block:: bash ======================== test session starts ========================= - platform darwin -- Python 3.7.0, pytest-4.0.0, py-1.7.0, pluggy-0.8.0 - rootdir: /Users/stevepiercy/projects/hack-on-pyramid/tutorial, inifile: pytest.ini - plugins: cov-2.6.0 - collected 1 item + platform darwin -- Python 3.7.3, pytest-5.3.2, py-1.8.1, pluggy-0.13.1 + rootdir: /filepath/tutorial, inifile: pytest.ini, testpaths: tutorial + plugins: cov-2.8.1 + collected 2 items + + tutorial/tests.py .. [100%] - tutorial/tests.py . - [100%] ---------- coverage: platform darwin, python 3.7.0-final-0 ----------- Name Stmts Miss Cover Missing ----------------------------------------------------------- - tutorial/__init__.py 17 12 29% 7-8, 14-23 + tutorial/__init__.py 16 11 31% 7-8, 14-22 tutorial/models/__init__.py 8 4 50% 9-12 tutorial/pshell.py 6 6 0% 1-12 tutorial/routes.py 2 2 0% 1-2 tutorial/views/__init__.py 0 0 100% tutorial/views/default.py 4 0 100% - tutorial/views/notfound.py 4 4 0% 1-7 + tutorial/views/notfound.py 4 0 100% ----------------------------------------------------------- - TOTAL 41 28 32% - + TOTAL 40 23 42% - ===================== 1 passed in 0.31 seconds ======================= + ===================== 2 passed in 0.55 seconds ======================= Our package doesn't quite have 100% test coverage. @@ -365,8 +366,8 @@ If successful, you will see something like this on your console: .. code-block:: text - Starting subprocess with file monitor - Starting server in PID 44078. + Starting monitor for PID 65233. + Starting server in PID 65233. Serving on http://localhost:6543 Serving on http://localhost:6543 diff --git a/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt index 9fdaef00f..9ca01382b 100644 --- a/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - + diff --git a/docs/tutorials/wiki/src/installation/tutorial/tests.py b/docs/tutorials/wiki/src/installation/tutorial/tests.py index 6279d9f66..aa5641cdd 100644 --- a/docs/tutorials/wiki/src/installation/tutorial/tests.py +++ b/docs/tutorials/wiki/src/installation/tutorial/tests.py @@ -16,3 +16,9 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'myproj') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/installation/tutorial/views/default.py b/docs/tutorials/wiki/src/installation/tutorial/views/default.py index 5d708d15c..51ec5ed98 100644 --- a/docs/tutorials/wiki/src/installation/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/installation/tutorial/views/default.py @@ -3,6 +3,6 @@ from pyramid.view import view_config from ..models import MyModel -@view_config(context=MyModel, renderer='../templates/mytemplate.pt') +@view_config(context=MyModel, renderer='tutorial:templates/mytemplate.pt') def my_view(request): return {'project': 'myproj'} diff --git a/docs/tutorials/wiki/src/installation/tutorial/views/notfound.py b/docs/tutorials/wiki/src/installation/tutorial/views/notfound.py index 728791d0a..59a37280e 100644 --- a/docs/tutorials/wiki/src/installation/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/installation/tutorial/views/notfound.py @@ -1,7 +1,7 @@ from pyramid.view import notfound_view_config -@notfound_view_config(renderer='../templates/404.pt') +@notfound_view_config(renderer='tutorial:templates/404.pt') def notfound_view(request): request.response.status = 404 return {} -- cgit v1.2.3 From 2e73919835c6480b6c5eb57dfb368812d6df9d43 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 27 Dec 2019 22:12:44 -0800 Subject: Update docs/tutorials/wiki/basiclayout.rst and related files --- docs/tutorials/wiki/basiclayout.rst | 18 ++++++++++++------ .../wiki/src/basiclayout/tutorial/templates/layout.pt | 2 +- docs/tutorials/wiki/src/basiclayout/tutorial/tests.py | 6 ++++++ .../wiki/src/basiclayout/tutorial/views/default.py | 2 +- .../wiki/src/basiclayout/tutorial/views/notfound.py | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index 52d3f4670..4eb5c4283 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -107,6 +107,12 @@ Next include routes from the ``.routes`` module. :lineno-match: :language: py +The included module contains the following function. + +.. literalinclude:: src/basiclayout/tutorial/routes.py + :linenos: + :language: py + This registers a "static view" using the :meth:`pyramid.config.Configurator.add_static_view` method. This view answers requests whose URL path starts with ``/static``. This statement registers a view that will serve up static assets, such as CSS and image files. @@ -121,7 +127,7 @@ Alternatively the cookiecutter could have used an *absolute* asset specification The third argument is an optional ``cache_max_age`` which specifies the number of seconds the static asset will be HTTP-cached. -Next perform a :term:`scan`. +Back into our ``__init__.py``, next perform a :term:`scan`. .. literalinclude:: src/basiclayout/tutorial/__init__.py :lines: 21 @@ -208,12 +214,12 @@ Let's try to understand the components in this module: The ``context`` argument signifies that the decorated view callable ``my_view`` should only be run when :term:`traversal` finds the ``tutorial.models.MyModel`` :term:`resource` as the :term:`context` of a request. In English this means that when the URL ``/`` is visited, and because ``MyModel`` is the root model, this view callable will be invoked. - The ``renderer`` argument names an :term:`asset specification` of ``templates/mytemplate.pt``. + The ``renderer`` argument names an :term:`asset specification` of ``tutorial:templates/mytemplate.pt``. This asset specification points at a :term:`Chameleon` template which lives in the ``mytemplate.pt`` file within the ``templates`` directory of the ``tutorial`` package. And indeed if you look in the ``templates`` directory of this package, you will see a ``mytemplate.pt`` template file This template renders the default home page of the generated project. - This asset specification is *relative* to the ``views`` package. - Alternatively we could have used the absolute asset specification ``tutorial:templates/mytemplate.pt``. + This asset specification is *absolute* to the ``views`` package. + Alternatively we could have used the relative asset specification ``../templates/mytemplate.pt``. Since this call to ``@view_config`` doesn't pass a ``name`` argument, the ``my_view`` function which it decorates represents the "default" view callable used when the context is of the type ``MyModel``. @@ -225,7 +231,7 @@ Let's try to understand the components in this module: The function returns the dictionary ``{'project': 'myproj'}``. This dictionary is used by the template named by the ``mytemplate.pt`` asset specification to fill in certain values on the page. -Let us open ``tutorial/views/default.py`` in the ``views`` package to look at the second view. +Let us open ``tutorial/views/notfound.py`` in the ``views`` package to look at the second view. .. literalinclude:: src/basiclayout/tutorial/views/notfound.py :linenos: @@ -237,7 +243,7 @@ Without repeating ourselves, we will point out the differences between this view The ``notfound_view`` function is decorated with ``@notfound_view_config``. This decorator registers a :term:`Not Found View` using :meth:`pyramid.config.Configurator.add_notfound_view`. - The ``renderer`` argument names an :term:`asset specification` of ``templates/404.pt``. + The ``renderer`` argument names an :term:`asset specification` of ``tutorial:templates/404.pt``. #. *Lines 5-7*. A :term:`view callable` named ``notfound_view`` is defined, which is decorated in the step above. diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt index 9fdaef00f..9ca01382b 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - + diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py b/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py index 6279d9f66..aa5641cdd 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py @@ -16,3 +16,9 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'myproj') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py b/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py index 5d708d15c..51ec5ed98 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py @@ -3,6 +3,6 @@ from pyramid.view import view_config from ..models import MyModel -@view_config(context=MyModel, renderer='../templates/mytemplate.pt') +@view_config(context=MyModel, renderer='tutorial:templates/mytemplate.pt') def my_view(request): return {'project': 'myproj'} diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/views/notfound.py b/docs/tutorials/wiki/src/basiclayout/tutorial/views/notfound.py index 728791d0a..59a37280e 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/views/notfound.py @@ -1,7 +1,7 @@ from pyramid.view import notfound_view_config -@notfound_view_config(renderer='../templates/404.pt') +@notfound_view_config(renderer='tutorial:templates/404.pt') def notfound_view(request): request.response.status = 404 return {} -- cgit v1.2.3 From 57fe1b6cb76717404ccc1777f2f3a4e6bf6b37a4 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 28 Dec 2019 00:21:57 -0800 Subject: Update docs/tutorials/wiki/definingviews.rst and related src files, and models src files --- docs/tutorials/wiki/definingviews.rst | 4 ++-- docs/tutorials/wiki/src/models/tutorial/templates/layout.pt | 2 +- docs/tutorials/wiki/src/models/tutorial/tests.py | 6 ++++++ docs/tutorials/wiki/src/models/tutorial/views/default.py | 2 +- docs/tutorials/wiki/src/models/tutorial/views/notfound.py | 2 +- docs/tutorials/wiki/src/views/tutorial/templates/layout.pt | 2 +- docs/tutorials/wiki/src/views/tutorial/tests.py | 6 ++++++ docs/tutorials/wiki/src/views/tutorial/views/default.py | 6 +++--- docs/tutorials/wiki/src/views/tutorial/views/notfound.py | 2 +- 9 files changed, 22 insertions(+), 10 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index bd8dc6ecf..2e4d009a1 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -73,7 +73,7 @@ Success executing this command will end with a line to the console similar to th .. code-block:: text - Successfully installed docutils-0.14 tutorial + Successfully installed docutils-0.15.2 tutorial Adding view functions in the ``views`` package @@ -356,7 +356,7 @@ Our templates name static assets, including CSS and images. We don't need to create these files within our package's ``static`` directory because they were provided by the cookiecutter at the time we created the project. As an example, the CSS file will be accessed via ``http://localhost:6543/static/theme.css`` by virtue of the call to the ``add_static_view`` directive in the ``routes.py`` file. -Any number and type of static assets can be placed in this directory (or subdirectories) +Any number and type of static assets can be placed in this directory (or subdirectories). They are referred to by either URL or using the convenience method ``static_url``, for example ``request.static_url(':static/foo.css')``, within templates. diff --git a/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt index 9fdaef00f..9ca01382b 100644 --- a/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - + diff --git a/docs/tutorials/wiki/src/models/tutorial/tests.py b/docs/tutorials/wiki/src/models/tutorial/tests.py index 6279d9f66..aa5641cdd 100644 --- a/docs/tutorials/wiki/src/models/tutorial/tests.py +++ b/docs/tutorials/wiki/src/models/tutorial/tests.py @@ -16,3 +16,9 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'myproj') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/models/tutorial/views/default.py b/docs/tutorials/wiki/src/models/tutorial/views/default.py index 5d708d15c..51ec5ed98 100644 --- a/docs/tutorials/wiki/src/models/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/models/tutorial/views/default.py @@ -3,6 +3,6 @@ from pyramid.view import view_config from ..models import MyModel -@view_config(context=MyModel, renderer='../templates/mytemplate.pt') +@view_config(context=MyModel, renderer='tutorial:templates/mytemplate.pt') def my_view(request): return {'project': 'myproj'} diff --git a/docs/tutorials/wiki/src/models/tutorial/views/notfound.py b/docs/tutorials/wiki/src/models/tutorial/views/notfound.py index 728791d0a..59a37280e 100644 --- a/docs/tutorials/wiki/src/models/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/models/tutorial/views/notfound.py @@ -1,7 +1,7 @@ from pyramid.view import notfound_view_config -@notfound_view_config(renderer='../templates/404.pt') +@notfound_view_config(renderer='tutorial:templates/404.pt') def notfound_view(request): request.response.status = 404 return {} diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt index b606e8dad..06a3c8157 100644 --- a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - + diff --git a/docs/tutorials/wiki/src/views/tutorial/tests.py b/docs/tutorials/wiki/src/views/tutorial/tests.py index 6279d9f66..aa5641cdd 100644 --- a/docs/tutorials/wiki/src/views/tutorial/tests.py +++ b/docs/tutorials/wiki/src/views/tutorial/tests.py @@ -16,3 +16,9 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'myproj') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/views/tutorial/views/default.py b/docs/tutorials/wiki/src/views/tutorial/views/default.py index b4b65a49b..e7921cf2f 100644 --- a/docs/tutorials/wiki/src/views/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/views/tutorial/views/default.py @@ -15,7 +15,7 @@ def view_wiki(context, request): return HTTPFound(location=request.resource_url(context, 'FrontPage')) -@view_config(context='..models.Page', renderer='../templates/view.pt') +@view_config(context='..models.Page', renderer='tutorial:templates/view.pt') def view_page(context, request): wiki = context.__parent__ @@ -36,7 +36,7 @@ def view_page(context, request): @view_config(name='add_page', context='..models.Wiki', - renderer='../templates/edit.pt') + renderer='tutorial:templates/edit.pt') def add_page(context, request): pagename = request.subpath[0] if 'form.submitted' in request.params: @@ -54,7 +54,7 @@ def add_page(context, request): @view_config(name='edit_page', context='..models.Page', - renderer='../templates/edit.pt') + renderer='tutorial:templates/edit.pt') def edit_page(context, request): if 'form.submitted' in request.params: context.data = request.params['body'] diff --git a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py index d44b4d0e6..dd0b00488 100644 --- a/docs/tutorials/wiki/src/views/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/views/tutorial/views/notfound.py @@ -3,7 +3,7 @@ from pyramid.view import notfound_view_config from ..models import Page -@notfound_view_config(renderer='../templates/404.pt') +@notfound_view_config(renderer='tutorial:templates/404.pt') def notfound_view(request): request.response.status = 404 pagename = request.path -- cgit v1.2.3 From a5f0644e08cea5b896135c7441d63d9ee7ed1c30 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 28 Dec 2019 00:36:56 -0800 Subject: Update docs/tutorials/wiki/authorization.rst and related src files --- docs/tutorials/wiki/authorization.rst | 10 +++++----- .../wiki/src/authorization/tutorial/templates/layout.pt | 2 +- docs/tutorials/wiki/src/authorization/tutorial/tests.py | 6 ++++++ .../tutorials/wiki/src/authorization/tutorial/views/default.py | 10 +++++----- .../wiki/src/authorization/tutorial/views/notfound.py | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/authorization.rst b/docs/tutorials/wiki/authorization.rst index ef914cab5..2ff9deb31 100644 --- a/docs/tutorials/wiki/authorization.rst +++ b/docs/tutorials/wiki/authorization.rst @@ -99,7 +99,7 @@ Here we use "dummy" data to represent user and groups sources. Add an ACL ~~~~~~~~~~ -Open ``tutorial/models.py`` and add the following import statement near the top: +Open ``tutorial/models/__init__.py`` and add the following import statement near the top: .. literalinclude:: src/authorization/tutorial/models/__init__.py :lines: 4-8 @@ -179,7 +179,7 @@ Open ``tutorial/views/default.py`` and add a ``permission='edit'`` parameter to :language: python .. literalinclude:: src/authorization/tutorial/views/default.py - :lines: 68-70 + :lines: 69-71 :emphasize-lines: 2-3 :language: python @@ -191,12 +191,12 @@ Add a ``permission='view'`` parameter to the ``@view_config`` decorator for ``view_wiki()`` and ``view_page()`` as follows: .. literalinclude:: src/authorization/tutorial/views/default.py - :lines: 23-24 + :lines: 21-22 :emphasize-lines: 1-2 :language: python .. literalinclude:: src/authorization/tutorial/views/default.py - :lines: 28-29 + :lines: 27-28 :emphasize-lines: 1-2 :language: python @@ -318,7 +318,7 @@ Our ``tutorial/__init__.py`` will look like this when we are done: Only the highlighted lines need to be added or edited. -Our ``tutorial/models.py`` will look like this when we are done: +Our ``tutorial/models/__init__.py`` will look like this when we are done: .. literalinclude:: src/authorization/tutorial/models/__init__.py :linenos: diff --git a/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt index b606e8dad..06a3c8157 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - + diff --git a/docs/tutorials/wiki/src/authorization/tutorial/tests.py b/docs/tutorials/wiki/src/authorization/tutorial/tests.py index 6279d9f66..aa5641cdd 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/tests.py +++ b/docs/tutorials/wiki/src/authorization/tutorial/tests.py @@ -16,3 +16,9 @@ class ViewTests(unittest.TestCase): info = my_view(request) self.assertEqual(info['project'], 'myproj') + def test_notfound_view(self): + from .views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/authorization/tutorial/views/default.py b/docs/tutorials/wiki/src/authorization/tutorial/views/default.py index 3a3b170e2..7ba99c65b 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/authorization/tutorial/views/default.py @@ -24,7 +24,7 @@ def view_wiki(context, request): return HTTPFound(location=request.resource_url(context, 'FrontPage')) -@view_config(context='..models.Page', renderer='../templates/view.pt', +@view_config(context='..models.Page', renderer='tutorial:templates/view.pt', permission='view') def view_page(context, request): wiki = context.__parent__ @@ -47,7 +47,7 @@ def view_page(context, request): @view_config(name='add_page', context='..models.Wiki', - renderer='../templates/edit.pt', + renderer='tutorial:templates/edit.pt', permission='edit') def add_page(context, request): pagename = request.subpath[0] @@ -67,7 +67,7 @@ def add_page(context, request): @view_config(name='edit_page', context='..models.Page', - renderer='../templates/edit.pt', + renderer='tutorial:templates/edit.pt', permission='edit') def edit_page(context, request): if 'form.submitted' in request.params: @@ -80,8 +80,8 @@ def edit_page(context, request): @view_config(context='..models.Wiki', name='login', - renderer='../templates/login.pt') -@forbidden_view_config(renderer='../templates/login.pt') + renderer='tutorial:templates/login.pt') +@forbidden_view_config(renderer='tutorial:templates/login.pt') def login(request): login_url = request.resource_url(request.context, 'login') referrer = request.url diff --git a/docs/tutorials/wiki/src/authorization/tutorial/views/notfound.py b/docs/tutorials/wiki/src/authorization/tutorial/views/notfound.py index d44b4d0e6..dd0b00488 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/authorization/tutorial/views/notfound.py @@ -3,7 +3,7 @@ from pyramid.view import notfound_view_config from ..models import Page -@notfound_view_config(renderer='../templates/404.pt') +@notfound_view_config(renderer='tutorial:templates/404.pt') def notfound_view(request): request.response.status = 404 pagename = request.path -- cgit v1.2.3 From fdf5bc0829d266bcee303ec725e76a1e7ec54d73 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 28 Dec 2019 00:39:07 -0800 Subject: Update src files for tests --- docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt | 2 +- docs/tutorials/wiki/src/tests/tutorial/views/default.py | 10 +++++----- docs/tutorials/wiki/src/tests/tutorial/views/notfound.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt index b606e8dad..06a3c8157 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - + diff --git a/docs/tutorials/wiki/src/tests/tutorial/views/default.py b/docs/tutorials/wiki/src/tests/tutorial/views/default.py index 3a3b170e2..7ba99c65b 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/tests/tutorial/views/default.py @@ -24,7 +24,7 @@ def view_wiki(context, request): return HTTPFound(location=request.resource_url(context, 'FrontPage')) -@view_config(context='..models.Page', renderer='../templates/view.pt', +@view_config(context='..models.Page', renderer='tutorial:templates/view.pt', permission='view') def view_page(context, request): wiki = context.__parent__ @@ -47,7 +47,7 @@ def view_page(context, request): @view_config(name='add_page', context='..models.Wiki', - renderer='../templates/edit.pt', + renderer='tutorial:templates/edit.pt', permission='edit') def add_page(context, request): pagename = request.subpath[0] @@ -67,7 +67,7 @@ def add_page(context, request): @view_config(name='edit_page', context='..models.Page', - renderer='../templates/edit.pt', + renderer='tutorial:templates/edit.pt', permission='edit') def edit_page(context, request): if 'form.submitted' in request.params: @@ -80,8 +80,8 @@ def edit_page(context, request): @view_config(context='..models.Wiki', name='login', - renderer='../templates/login.pt') -@forbidden_view_config(renderer='../templates/login.pt') + renderer='tutorial:templates/login.pt') +@forbidden_view_config(renderer='tutorial:templates/login.pt') def login(request): login_url = request.resource_url(request.context, 'login') referrer = request.url diff --git a/docs/tutorials/wiki/src/tests/tutorial/views/notfound.py b/docs/tutorials/wiki/src/tests/tutorial/views/notfound.py index d44b4d0e6..dd0b00488 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/views/notfound.py +++ b/docs/tutorials/wiki/src/tests/tutorial/views/notfound.py @@ -3,7 +3,7 @@ from pyramid.view import notfound_view_config from ..models import Page -@notfound_view_config(renderer='../templates/404.pt') +@notfound_view_config(renderer='tutorial:templates/404.pt') def notfound_view(request): request.response.status = 404 pagename = request.path -- cgit v1.2.3 From 6175ff659c2523974072b404636911ebb89c2d42 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 1 Jan 2020 20:15:20 -0800 Subject: Resync wiki/*.rst and related files after moving tests directory --- docs/tutorials/wiki/installation.rst | 4 +- docs/tutorials/wiki/src/authorization/MANIFEST.in | 3 + docs/tutorials/wiki/src/authorization/pytest.ini | 7 +- .../wiki/src/authorization/tests/__init__.py | 0 .../wiki/src/authorization/tests/test_it.py | 24 +++ .../wiki/src/authorization/tutorial/tests.py | 24 --- docs/tutorials/wiki/src/basiclayout/MANIFEST.in | 3 + docs/tutorials/wiki/src/basiclayout/pytest.ini | 7 +- .../wiki/src/basiclayout/tests/__init__.py | 0 .../wiki/src/basiclayout/tests/test_it.py | 24 +++ .../wiki/src/basiclayout/tutorial/tests.py | 24 --- docs/tutorials/wiki/src/installation/MANIFEST.in | 3 + docs/tutorials/wiki/src/installation/pytest.ini | 7 +- .../wiki/src/installation/tests/__init__.py | 0 .../wiki/src/installation/tests/test_it.py | 24 +++ .../wiki/src/installation/tutorial/tests.py | 24 --- docs/tutorials/wiki/src/models/MANIFEST.in | 3 + docs/tutorials/wiki/src/models/pytest.ini | 7 +- docs/tutorials/wiki/src/models/tests/__init__.py | 0 docs/tutorials/wiki/src/models/tests/test_it.py | 24 +++ docs/tutorials/wiki/src/models/tutorial/tests.py | 24 --- docs/tutorials/wiki/src/tests/MANIFEST.in | 3 + docs/tutorials/wiki/src/tests/pytest.ini | 7 +- docs/tutorials/wiki/src/tests/tests/__init__.py | 0 docs/tutorials/wiki/src/tests/tests/test_it.py | 232 +++++++++++++++++++++ docs/tutorials/wiki/src/tests/tutorial/tests.py | 232 --------------------- docs/tutorials/wiki/src/views/MANIFEST.in | 3 + docs/tutorials/wiki/src/views/pytest.ini | 7 +- docs/tutorials/wiki/src/views/tests/__init__.py | 0 docs/tutorials/wiki/src/views/tests/test_it.py | 24 +++ docs/tutorials/wiki/src/views/tutorial/tests.py | 24 --- docs/tutorials/wiki/tests.rst | 16 +- 32 files changed, 410 insertions(+), 374 deletions(-) create mode 100644 docs/tutorials/wiki/src/authorization/tests/__init__.py create mode 100644 docs/tutorials/wiki/src/authorization/tests/test_it.py delete mode 100644 docs/tutorials/wiki/src/authorization/tutorial/tests.py create mode 100644 docs/tutorials/wiki/src/basiclayout/tests/__init__.py create mode 100644 docs/tutorials/wiki/src/basiclayout/tests/test_it.py delete mode 100644 docs/tutorials/wiki/src/basiclayout/tutorial/tests.py create mode 100644 docs/tutorials/wiki/src/installation/tests/__init__.py create mode 100644 docs/tutorials/wiki/src/installation/tests/test_it.py delete mode 100644 docs/tutorials/wiki/src/installation/tutorial/tests.py create mode 100644 docs/tutorials/wiki/src/models/tests/__init__.py create mode 100644 docs/tutorials/wiki/src/models/tests/test_it.py delete mode 100644 docs/tutorials/wiki/src/models/tutorial/tests.py create mode 100644 docs/tutorials/wiki/src/tests/tests/__init__.py create mode 100644 docs/tutorials/wiki/src/tests/tests/test_it.py delete mode 100644 docs/tutorials/wiki/src/tests/tutorial/tests.py create mode 100644 docs/tutorials/wiki/src/views/tests/__init__.py create mode 100644 docs/tutorials/wiki/src/views/tests/test_it.py delete mode 100644 docs/tutorials/wiki/src/views/tutorial/tests.py (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index 7c21ec02c..6088f577d 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -317,14 +317,14 @@ On Unix .. code-block:: bash - $VENV/bin/pytest --cov=tutorial tutorial/tests.py -q + $VENV/bin/pytest --cov=tutorial tests.py -q On Windows ^^^^^^^^^^ .. code-block:: doscon - %VENV%\Scripts\pytest --cov=tutorial tutorial\tests.py -q + %VENV%\Scripts\pytest --cov=tutorial tests -q ``pytest`` follows :ref:`conventions for Python test discovery `. diff --git a/docs/tutorials/wiki/src/authorization/MANIFEST.in b/docs/tutorials/wiki/src/authorization/MANIFEST.in index 05cc195d9..b4624fd1c 100644 --- a/docs/tutorials/wiki/src/authorization/MANIFEST.in +++ b/docs/tutorials/wiki/src/authorization/MANIFEST.in @@ -1,2 +1,5 @@ include *.txt *.ini *.cfg *.rst recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/docs/tutorials/wiki/src/authorization/pytest.ini b/docs/tutorials/wiki/src/authorization/pytest.ini index a3489cdf8..42c3259f9 100644 --- a/docs/tutorials/wiki/src/authorization/pytest.ini +++ b/docs/tutorials/wiki/src/authorization/pytest.ini @@ -1,3 +1,6 @@ [pytest] -testpaths = tutorial -python_files = test*.py +addopts = --strict + +testpaths = + tutorial + tests diff --git a/docs/tutorials/wiki/src/authorization/tests/__init__.py b/docs/tutorials/wiki/src/authorization/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tutorials/wiki/src/authorization/tests/test_it.py b/docs/tutorials/wiki/src/authorization/tests/test_it.py new file mode 100644 index 000000000..6c72bcc62 --- /dev/null +++ b/docs/tutorials/wiki/src/authorization/tests/test_it.py @@ -0,0 +1,24 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from tutorial.views.default import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'myproj') + + def test_notfound_view(self): + from tutorial.views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/authorization/tutorial/tests.py b/docs/tutorials/wiki/src/authorization/tutorial/tests.py deleted file mode 100644 index aa5641cdd..000000000 --- a/docs/tutorials/wiki/src/authorization/tutorial/tests.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views.default import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'myproj') - - def test_notfound_view(self): - from .views.notfound import notfound_view - request = testing.DummyRequest() - info = notfound_view(request) - self.assertEqual(info, {}) - diff --git a/docs/tutorials/wiki/src/basiclayout/MANIFEST.in b/docs/tutorials/wiki/src/basiclayout/MANIFEST.in index 05cc195d9..b4624fd1c 100644 --- a/docs/tutorials/wiki/src/basiclayout/MANIFEST.in +++ b/docs/tutorials/wiki/src/basiclayout/MANIFEST.in @@ -1,2 +1,5 @@ include *.txt *.ini *.cfg *.rst recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/docs/tutorials/wiki/src/basiclayout/pytest.ini b/docs/tutorials/wiki/src/basiclayout/pytest.ini index a3489cdf8..42c3259f9 100644 --- a/docs/tutorials/wiki/src/basiclayout/pytest.ini +++ b/docs/tutorials/wiki/src/basiclayout/pytest.ini @@ -1,3 +1,6 @@ [pytest] -testpaths = tutorial -python_files = test*.py +addopts = --strict + +testpaths = + tutorial + tests diff --git a/docs/tutorials/wiki/src/basiclayout/tests/__init__.py b/docs/tutorials/wiki/src/basiclayout/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tutorials/wiki/src/basiclayout/tests/test_it.py b/docs/tutorials/wiki/src/basiclayout/tests/test_it.py new file mode 100644 index 000000000..6c72bcc62 --- /dev/null +++ b/docs/tutorials/wiki/src/basiclayout/tests/test_it.py @@ -0,0 +1,24 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from tutorial.views.default import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'myproj') + + def test_notfound_view(self): + from tutorial.views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py b/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py deleted file mode 100644 index aa5641cdd..000000000 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/tests.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views.default import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'myproj') - - def test_notfound_view(self): - from .views.notfound import notfound_view - request = testing.DummyRequest() - info = notfound_view(request) - self.assertEqual(info, {}) - diff --git a/docs/tutorials/wiki/src/installation/MANIFEST.in b/docs/tutorials/wiki/src/installation/MANIFEST.in index 05cc195d9..b4624fd1c 100644 --- a/docs/tutorials/wiki/src/installation/MANIFEST.in +++ b/docs/tutorials/wiki/src/installation/MANIFEST.in @@ -1,2 +1,5 @@ include *.txt *.ini *.cfg *.rst recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/docs/tutorials/wiki/src/installation/pytest.ini b/docs/tutorials/wiki/src/installation/pytest.ini index a3489cdf8..42c3259f9 100644 --- a/docs/tutorials/wiki/src/installation/pytest.ini +++ b/docs/tutorials/wiki/src/installation/pytest.ini @@ -1,3 +1,6 @@ [pytest] -testpaths = tutorial -python_files = test*.py +addopts = --strict + +testpaths = + tutorial + tests diff --git a/docs/tutorials/wiki/src/installation/tests/__init__.py b/docs/tutorials/wiki/src/installation/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tutorials/wiki/src/installation/tests/test_it.py b/docs/tutorials/wiki/src/installation/tests/test_it.py new file mode 100644 index 000000000..6c72bcc62 --- /dev/null +++ b/docs/tutorials/wiki/src/installation/tests/test_it.py @@ -0,0 +1,24 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from tutorial.views.default import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'myproj') + + def test_notfound_view(self): + from tutorial.views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/installation/tutorial/tests.py b/docs/tutorials/wiki/src/installation/tutorial/tests.py deleted file mode 100644 index aa5641cdd..000000000 --- a/docs/tutorials/wiki/src/installation/tutorial/tests.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views.default import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'myproj') - - def test_notfound_view(self): - from .views.notfound import notfound_view - request = testing.DummyRequest() - info = notfound_view(request) - self.assertEqual(info, {}) - diff --git a/docs/tutorials/wiki/src/models/MANIFEST.in b/docs/tutorials/wiki/src/models/MANIFEST.in index 05cc195d9..b4624fd1c 100644 --- a/docs/tutorials/wiki/src/models/MANIFEST.in +++ b/docs/tutorials/wiki/src/models/MANIFEST.in @@ -1,2 +1,5 @@ include *.txt *.ini *.cfg *.rst recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/docs/tutorials/wiki/src/models/pytest.ini b/docs/tutorials/wiki/src/models/pytest.ini index a3489cdf8..42c3259f9 100644 --- a/docs/tutorials/wiki/src/models/pytest.ini +++ b/docs/tutorials/wiki/src/models/pytest.ini @@ -1,3 +1,6 @@ [pytest] -testpaths = tutorial -python_files = test*.py +addopts = --strict + +testpaths = + tutorial + tests diff --git a/docs/tutorials/wiki/src/models/tests/__init__.py b/docs/tutorials/wiki/src/models/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tutorials/wiki/src/models/tests/test_it.py b/docs/tutorials/wiki/src/models/tests/test_it.py new file mode 100644 index 000000000..6c72bcc62 --- /dev/null +++ b/docs/tutorials/wiki/src/models/tests/test_it.py @@ -0,0 +1,24 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from tutorial.views.default import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'myproj') + + def test_notfound_view(self): + from tutorial.views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/models/tutorial/tests.py b/docs/tutorials/wiki/src/models/tutorial/tests.py deleted file mode 100644 index aa5641cdd..000000000 --- a/docs/tutorials/wiki/src/models/tutorial/tests.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views.default import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'myproj') - - def test_notfound_view(self): - from .views.notfound import notfound_view - request = testing.DummyRequest() - info = notfound_view(request) - self.assertEqual(info, {}) - diff --git a/docs/tutorials/wiki/src/tests/MANIFEST.in b/docs/tutorials/wiki/src/tests/MANIFEST.in index 05cc195d9..b4624fd1c 100644 --- a/docs/tutorials/wiki/src/tests/MANIFEST.in +++ b/docs/tutorials/wiki/src/tests/MANIFEST.in @@ -1,2 +1,5 @@ include *.txt *.ini *.cfg *.rst recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/docs/tutorials/wiki/src/tests/pytest.ini b/docs/tutorials/wiki/src/tests/pytest.ini index a3489cdf8..42c3259f9 100644 --- a/docs/tutorials/wiki/src/tests/pytest.ini +++ b/docs/tutorials/wiki/src/tests/pytest.ini @@ -1,3 +1,6 @@ [pytest] -testpaths = tutorial -python_files = test*.py +addopts = --strict + +testpaths = + tutorial + tests diff --git a/docs/tutorials/wiki/src/tests/tests/__init__.py b/docs/tutorials/wiki/src/tests/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tutorials/wiki/src/tests/tests/test_it.py b/docs/tutorials/wiki/src/tests/tests/test_it.py new file mode 100644 index 000000000..e45380e6f --- /dev/null +++ b/docs/tutorials/wiki/src/tests/tests/test_it.py @@ -0,0 +1,232 @@ +import unittest + +from pyramid import testing + +class PageModelTests(unittest.TestCase): + + def _getTargetClass(self): + from tutorial.models import Page + return Page + + def _makeOne(self, data='some data'): + return self._getTargetClass()(data=data) + + def test_constructor(self): + instance = self._makeOne() + self.assertEqual(instance.data, 'some data') + +class WikiModelTests(unittest.TestCase): + + def _getTargetClass(self): + from tutorial.models import Wiki + return Wiki + + def _makeOne(self): + return self._getTargetClass()() + + def test_it(self): + wiki = self._makeOne() + self.assertEqual(wiki.__parent__, None) + self.assertEqual(wiki.__name__, None) + +class AppmakerTests(unittest.TestCase): + + def _callFUT(self, zodb_root): + from tutorial.models import appmaker + return appmaker(zodb_root) + + def test_it(self): + root = {} + self._callFUT(root) + self.assertEqual(root['app_root']['FrontPage'].data, + 'This is the front page') + +class ViewWikiTests(unittest.TestCase): + def test_it(self): + from tutorial.views.default import view_wiki + context = testing.DummyResource() + request = testing.DummyRequest() + response = view_wiki(context, request) + self.assertEqual(response.location, 'http://example.com/FrontPage') + +class ViewPageTests(unittest.TestCase): + def _callFUT(self, context, request): + from tutorial.views.default import view_page + return view_page(context, request) + + def test_it(self): + wiki = testing.DummyResource() + wiki['IDoExist'] = testing.DummyResource() + context = testing.DummyResource(data='Hello CruelWorld IDoExist') + context.__parent__ = wiki + context.__name__ = 'thepage' + request = testing.DummyRequest() + info = self._callFUT(context, request) + self.assertEqual(info['page'], context) + self.assertEqual( + info['page_text'], + '
\n' + '

Hello ' + 'CruelWorld ' + '' + 'IDoExist' + '

\n
\n') + self.assertEqual(info['edit_url'], + 'http://example.com/thepage/edit_page') + + +class AddPageTests(unittest.TestCase): + def _callFUT(self, context, request): + from tutorial.views.default import add_page + return add_page(context, request) + + def test_it_notsubmitted(self): + context = testing.DummyResource() + request = testing.DummyRequest() + request.subpath = ['AnotherPage'] + info = self._callFUT(context, request) + self.assertEqual(info['page'].data,'') + self.assertEqual( + info['save_url'], + request.resource_url(context, 'add_page', 'AnotherPage')) + + def test_it_submitted(self): + context = testing.DummyResource() + request = testing.DummyRequest({'form.submitted':True, + 'body':'Hello yo!'}) + request.subpath = ['AnotherPage'] + self._callFUT(context, request) + page = context['AnotherPage'] + self.assertEqual(page.data, 'Hello yo!') + self.assertEqual(page.__name__, 'AnotherPage') + self.assertEqual(page.__parent__, context) + +class EditPageTests(unittest.TestCase): + def _callFUT(self, context, request): + from tutorial.views.default import edit_page + return edit_page(context, request) + + def test_it_notsubmitted(self): + context = testing.DummyResource() + request = testing.DummyRequest() + info = self._callFUT(context, request) + self.assertEqual(info['page'], context) + self.assertEqual(info['save_url'], + request.resource_url(context, 'edit_page')) + + def test_it_submitted(self): + context = testing.DummyResource() + request = testing.DummyRequest({'form.submitted':True, + 'body':'Hello yo!'}) + response = self._callFUT(context, request) + self.assertEqual(response.location, 'http://example.com/') + self.assertEqual(context.data, 'Hello yo!') + +class SecurityTests(unittest.TestCase): + def test_hashing(self): + from tutorial.security import hash_password, check_password + password = 'secretpassword' + hashed_password = hash_password(password) + self.assertTrue(check_password(hashed_password, password)) + + self.assertFalse(check_password(hashed_password, 'attackerpassword')) + + self.assertFalse(check_password(None, password)) + +class FunctionalTests(unittest.TestCase): + + viewer_login = '/login?login=viewer&password=viewer' \ + '&came_from=FrontPage&form.submitted=Login' + viewer_wrong_login = '/login?login=viewer&password=incorrect' \ + '&came_from=FrontPage&form.submitted=Login' + editor_login = '/login?login=editor&password=editor' \ + '&came_from=FrontPage&form.submitted=Login' + + def setUp(self): + import tempfile + import os.path + from tutorial import main + self.tmpdir = tempfile.mkdtemp() + + dbpath = os.path.join( self.tmpdir, 'test.db') + uri = 'file://' + dbpath + settings = { 'zodbconn.uri' : uri , + 'pyramid.includes': ['pyramid_zodbconn', 'pyramid_tm'] } + + app = main({}, **settings) + self.db = app.registry._zodb_databases[''] + from webtest import TestApp + self.testapp = TestApp(app) + + def tearDown(self): + import shutil + self.db.close() + shutil.rmtree( self.tmpdir ) + + def test_root(self): + res = self.testapp.get('/', status=302) + self.assertEqual(res.location, 'http://localhost/FrontPage') + + def test_FrontPage(self): + res = self.testapp.get('/FrontPage', status=200) + self.assertTrue(b'FrontPage' in res.body) + + def test_unexisting_page(self): + res = self.testapp.get('/SomePage', status=404) + self.assertTrue(b'Not Found' in res.body) + + def test_referrer_is_login(self): + res = self.testapp.get('/login', status=200) + self.assertTrue(b'name="came_from" value="/"' in res.body) + + def test_successful_log_in(self): + res = self.testapp.get( self.viewer_login, status=302) + self.assertEqual(res.location, 'http://localhost/FrontPage') + + def test_failed_log_in(self): + res = self.testapp.get( self.viewer_wrong_login, status=200) + self.assertTrue(b'login' in res.body) + + def test_logout_link_present_when_logged_in(self): + res = self.testapp.get( self.viewer_login, status=302) + res = self.testapp.get('/FrontPage', status=200) + self.assertTrue(b'Logout' in res.body) + + def test_logout_link_not_present_after_logged_out(self): + res = self.testapp.get( self.viewer_login, status=302) + res = self.testapp.get('/FrontPage', status=200) + res = self.testapp.get('/logout', status=302) + self.assertTrue(b'Logout' not in res.body) + + def test_anonymous_user_cannot_edit(self): + res = self.testapp.get('/FrontPage/edit_page', status=200) + self.assertTrue(b'Login' in res.body) + + def test_anonymous_user_cannot_add(self): + res = self.testapp.get('/add_page/NewPage', status=200) + self.assertTrue(b'Login' in res.body) + + def test_viewer_user_cannot_edit(self): + res = self.testapp.get( self.viewer_login, status=302) + res = self.testapp.get('/FrontPage/edit_page', status=200) + self.assertTrue(b'Login' in res.body) + + def test_viewer_user_cannot_add(self): + res = self.testapp.get( self.viewer_login, status=302) + res = self.testapp.get('/add_page/NewPage', status=200) + self.assertTrue(b'Login' in res.body) + + def test_editors_member_user_can_edit(self): + res = self.testapp.get( self.editor_login, status=302) + res = self.testapp.get('/FrontPage/edit_page', status=200) + self.assertTrue(b'Editing' in res.body) + + def test_editors_member_user_can_add(self): + res = self.testapp.get( self.editor_login, status=302) + res = self.testapp.get('/add_page/NewPage', status=200) + self.assertTrue(b'Editing' in res.body) + + def test_editors_member_user_can_view(self): + res = self.testapp.get( self.editor_login, status=302) + res = self.testapp.get('/FrontPage', status=200) + self.assertTrue(b'FrontPage' in res.body) diff --git a/docs/tutorials/wiki/src/tests/tutorial/tests.py b/docs/tutorials/wiki/src/tests/tutorial/tests.py deleted file mode 100644 index ff1c07b7c..000000000 --- a/docs/tutorials/wiki/src/tests/tutorial/tests.py +++ /dev/null @@ -1,232 +0,0 @@ -import unittest - -from pyramid import testing - -class PageModelTests(unittest.TestCase): - - def _getTargetClass(self): - from .models import Page - return Page - - def _makeOne(self, data='some data'): - return self._getTargetClass()(data=data) - - def test_constructor(self): - instance = self._makeOne() - self.assertEqual(instance.data, 'some data') - -class WikiModelTests(unittest.TestCase): - - def _getTargetClass(self): - from .models import Wiki - return Wiki - - def _makeOne(self): - return self._getTargetClass()() - - def test_it(self): - wiki = self._makeOne() - self.assertEqual(wiki.__parent__, None) - self.assertEqual(wiki.__name__, None) - -class AppmakerTests(unittest.TestCase): - - def _callFUT(self, zodb_root): - from .models import appmaker - return appmaker(zodb_root) - - def test_it(self): - root = {} - self._callFUT(root) - self.assertEqual(root['app_root']['FrontPage'].data, - 'This is the front page') - -class ViewWikiTests(unittest.TestCase): - def test_it(self): - from .views.default import view_wiki - context = testing.DummyResource() - request = testing.DummyRequest() - response = view_wiki(context, request) - self.assertEqual(response.location, 'http://example.com/FrontPage') - -class ViewPageTests(unittest.TestCase): - def _callFUT(self, context, request): - from .views.default import view_page - return view_page(context, request) - - def test_it(self): - wiki = testing.DummyResource() - wiki['IDoExist'] = testing.DummyResource() - context = testing.DummyResource(data='Hello CruelWorld IDoExist') - context.__parent__ = wiki - context.__name__ = 'thepage' - request = testing.DummyRequest() - info = self._callFUT(context, request) - self.assertEqual(info['page'], context) - self.assertEqual( - info['page_text'], - '
\n' - '

Hello ' - 'CruelWorld ' - '' - 'IDoExist' - '

\n
\n') - self.assertEqual(info['edit_url'], - 'http://example.com/thepage/edit_page') - - -class AddPageTests(unittest.TestCase): - def _callFUT(self, context, request): - from .views.default import add_page - return add_page(context, request) - - def test_it_notsubmitted(self): - context = testing.DummyResource() - request = testing.DummyRequest() - request.subpath = ['AnotherPage'] - info = self._callFUT(context, request) - self.assertEqual(info['page'].data,'') - self.assertEqual( - info['save_url'], - request.resource_url(context, 'add_page', 'AnotherPage')) - - def test_it_submitted(self): - context = testing.DummyResource() - request = testing.DummyRequest({'form.submitted':True, - 'body':'Hello yo!'}) - request.subpath = ['AnotherPage'] - self._callFUT(context, request) - page = context['AnotherPage'] - self.assertEqual(page.data, 'Hello yo!') - self.assertEqual(page.__name__, 'AnotherPage') - self.assertEqual(page.__parent__, context) - -class EditPageTests(unittest.TestCase): - def _callFUT(self, context, request): - from .views.default import edit_page - return edit_page(context, request) - - def test_it_notsubmitted(self): - context = testing.DummyResource() - request = testing.DummyRequest() - info = self._callFUT(context, request) - self.assertEqual(info['page'], context) - self.assertEqual(info['save_url'], - request.resource_url(context, 'edit_page')) - - def test_it_submitted(self): - context = testing.DummyResource() - request = testing.DummyRequest({'form.submitted':True, - 'body':'Hello yo!'}) - response = self._callFUT(context, request) - self.assertEqual(response.location, 'http://example.com/') - self.assertEqual(context.data, 'Hello yo!') - -class SecurityTests(unittest.TestCase): - def test_hashing(self): - from .security import hash_password, check_password - password = 'secretpassword' - hashed_password = hash_password(password) - self.assertTrue(check_password(hashed_password, password)) - - self.assertFalse(check_password(hashed_password, 'attackerpassword')) - - self.assertFalse(check_password(None, password)) - -class FunctionalTests(unittest.TestCase): - - viewer_login = '/login?login=viewer&password=viewer' \ - '&came_from=FrontPage&form.submitted=Login' - viewer_wrong_login = '/login?login=viewer&password=incorrect' \ - '&came_from=FrontPage&form.submitted=Login' - editor_login = '/login?login=editor&password=editor' \ - '&came_from=FrontPage&form.submitted=Login' - - def setUp(self): - import tempfile - import os.path - from . import main - self.tmpdir = tempfile.mkdtemp() - - dbpath = os.path.join( self.tmpdir, 'test.db') - uri = 'file://' + dbpath - settings = { 'zodbconn.uri' : uri , - 'pyramid.includes': ['pyramid_zodbconn', 'pyramid_tm'] } - - app = main({}, **settings) - self.db = app.registry._zodb_databases[''] - from webtest import TestApp - self.testapp = TestApp(app) - - def tearDown(self): - import shutil - self.db.close() - shutil.rmtree( self.tmpdir ) - - def test_root(self): - res = self.testapp.get('/', status=302) - self.assertEqual(res.location, 'http://localhost/FrontPage') - - def test_FrontPage(self): - res = self.testapp.get('/FrontPage', status=200) - self.assertTrue(b'FrontPage' in res.body) - - def test_unexisting_page(self): - res = self.testapp.get('/SomePage', status=404) - self.assertTrue(b'Not Found' in res.body) - - def test_referrer_is_login(self): - res = self.testapp.get('/login', status=200) - self.assertTrue(b'name="came_from" value="/"' in res.body) - - def test_successful_log_in(self): - res = self.testapp.get( self.viewer_login, status=302) - self.assertEqual(res.location, 'http://localhost/FrontPage') - - def test_failed_log_in(self): - res = self.testapp.get( self.viewer_wrong_login, status=200) - self.assertTrue(b'login' in res.body) - - def test_logout_link_present_when_logged_in(self): - res = self.testapp.get( self.viewer_login, status=302) - res = self.testapp.get('/FrontPage', status=200) - self.assertTrue(b'Logout' in res.body) - - def test_logout_link_not_present_after_logged_out(self): - res = self.testapp.get( self.viewer_login, status=302) - res = self.testapp.get('/FrontPage', status=200) - res = self.testapp.get('/logout', status=302) - self.assertTrue(b'Logout' not in res.body) - - def test_anonymous_user_cannot_edit(self): - res = self.testapp.get('/FrontPage/edit_page', status=200) - self.assertTrue(b'Login' in res.body) - - def test_anonymous_user_cannot_add(self): - res = self.testapp.get('/add_page/NewPage', status=200) - self.assertTrue(b'Login' in res.body) - - def test_viewer_user_cannot_edit(self): - res = self.testapp.get( self.viewer_login, status=302) - res = self.testapp.get('/FrontPage/edit_page', status=200) - self.assertTrue(b'Login' in res.body) - - def test_viewer_user_cannot_add(self): - res = self.testapp.get( self.viewer_login, status=302) - res = self.testapp.get('/add_page/NewPage', status=200) - self.assertTrue(b'Login' in res.body) - - def test_editors_member_user_can_edit(self): - res = self.testapp.get( self.editor_login, status=302) - res = self.testapp.get('/FrontPage/edit_page', status=200) - self.assertTrue(b'Editing' in res.body) - - def test_editors_member_user_can_add(self): - res = self.testapp.get( self.editor_login, status=302) - res = self.testapp.get('/add_page/NewPage', status=200) - self.assertTrue(b'Editing' in res.body) - - def test_editors_member_user_can_view(self): - res = self.testapp.get( self.editor_login, status=302) - res = self.testapp.get('/FrontPage', status=200) - self.assertTrue(b'FrontPage' in res.body) diff --git a/docs/tutorials/wiki/src/views/MANIFEST.in b/docs/tutorials/wiki/src/views/MANIFEST.in index 05cc195d9..b4624fd1c 100644 --- a/docs/tutorials/wiki/src/views/MANIFEST.in +++ b/docs/tutorials/wiki/src/views/MANIFEST.in @@ -1,2 +1,5 @@ include *.txt *.ini *.cfg *.rst recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 +recursive-include tests * +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] diff --git a/docs/tutorials/wiki/src/views/pytest.ini b/docs/tutorials/wiki/src/views/pytest.ini index a3489cdf8..42c3259f9 100644 --- a/docs/tutorials/wiki/src/views/pytest.ini +++ b/docs/tutorials/wiki/src/views/pytest.ini @@ -1,3 +1,6 @@ [pytest] -testpaths = tutorial -python_files = test*.py +addopts = --strict + +testpaths = + tutorial + tests diff --git a/docs/tutorials/wiki/src/views/tests/__init__.py b/docs/tutorials/wiki/src/views/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/docs/tutorials/wiki/src/views/tests/test_it.py b/docs/tutorials/wiki/src/views/tests/test_it.py new file mode 100644 index 000000000..6c72bcc62 --- /dev/null +++ b/docs/tutorials/wiki/src/views/tests/test_it.py @@ -0,0 +1,24 @@ +import unittest + +from pyramid import testing + + +class ViewTests(unittest.TestCase): + def setUp(self): + self.config = testing.setUp() + + def tearDown(self): + testing.tearDown() + + def test_my_view(self): + from tutorial.views.default import my_view + request = testing.DummyRequest() + info = my_view(request) + self.assertEqual(info['project'], 'myproj') + + def test_notfound_view(self): + from tutorial.views.notfound import notfound_view + request = testing.DummyRequest() + info = notfound_view(request) + self.assertEqual(info, {}) + diff --git a/docs/tutorials/wiki/src/views/tutorial/tests.py b/docs/tutorials/wiki/src/views/tutorial/tests.py deleted file mode 100644 index aa5641cdd..000000000 --- a/docs/tutorials/wiki/src/views/tutorial/tests.py +++ /dev/null @@ -1,24 +0,0 @@ -import unittest - -from pyramid import testing - - -class ViewTests(unittest.TestCase): - def setUp(self): - self.config = testing.setUp() - - def tearDown(self): - testing.tearDown() - - def test_my_view(self): - from .views.default import my_view - request = testing.DummyRequest() - info = my_view(request) - self.assertEqual(info['project'], 'myproj') - - def test_notfound_view(self): - from .views.notfound import notfound_view - request = testing.DummyRequest() - info = notfound_view(request) - self.assertEqual(info, {}) - diff --git a/docs/tutorials/wiki/tests.rst b/docs/tutorials/wiki/tests.rst index 9dacc5f96..f710b3b10 100644 --- a/docs/tutorials/wiki/tests.rst +++ b/docs/tutorials/wiki/tests.rst @@ -4,7 +4,7 @@ Adding Tests ============ -We will now add tests for the models and the views and a few functional tests in ``tests.py``. +We will now add tests for the models and the views and a few functional tests in ``tests/test_it.py``. Tests ensure that an application works, and that it continues to work when changes are made in the future. @@ -12,10 +12,9 @@ Test the models =============== We write tests for the ``model`` classes and the ``appmaker``. -Changing ``tests.py``, we will write a separate test class for each ``model`` class +We will modify our ``test_it.py`` file, writing a separate test class for each ``model`` class. We will also write a test class for the ``appmaker``. -To do so, we will retain the ``tutorial.tests.ViewTests`` class that was generated from choosing the ``zodb`` backend option. We will add three test classes, one for each of the following: - the ``Page`` model named ``PageModelTests`` @@ -26,7 +25,7 @@ We will add three test classes, one for each of the following: Test the views ============== -We will modify our ``tests.py`` file, adding tests for each view function that we added previously. +We will modify our ``test_it.py`` file, adding tests for each view function that we added previously. As a result, we will delete the ``ViewTests`` class that the ``zodb`` backend option provided, and add four other test classes: ``ViewWikiTests``, ``ViewPageTests``, ``AddPageTests``, and ``EditPageTests``. These test the ``view_wiki``, ``view_page``, ``add_page``, and ``edit_page`` views. @@ -35,14 +34,15 @@ Functional tests ================ We will test the whole application, covering security aspects that are not tested in the unit tests, such as logging in, logging out, checking that the ``viewer`` user cannot add or edit pages, but the ``editor`` user can, and so on. +As a result we will add two test classes, ``SecurityTests`` and ``FunctionalTests``. -View the results of all our edits to ``tests.py`` -================================================= +View the results of all our edits to ``tests/test_it.py`` +========================================================= -Open the ``tutorial/tests.py`` module, and edit it such that it appears as follows: +Open the ``tests/test_it.py`` module, and edit it such that it appears as follows: -.. literalinclude:: src/tests/tutorial/tests.py +.. literalinclude:: src/tests/tests/test_it.py :linenos: :language: python -- cgit v1.2.3 From b8cc2a85919757bcf5582c683eaff7d384cdfa03 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Wed, 1 Jan 2020 23:07:32 -0800 Subject: Resynch docs with cookiecutter - remove unnecessary `omit` line in .coveragerc --- docs/tutorials/wiki/src/authorization/.coveragerc | 1 - docs/tutorials/wiki/src/basiclayout/.coveragerc | 1 - docs/tutorials/wiki/src/installation/.coveragerc | 1 - docs/tutorials/wiki/src/models/.coveragerc | 1 - docs/tutorials/wiki/src/tests/.coveragerc | 1 - docs/tutorials/wiki/src/views/.coveragerc | 1 - 6 files changed, 6 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/src/authorization/.coveragerc b/docs/tutorials/wiki/src/authorization/.coveragerc index a1d87d03d..5db0e79cf 100644 --- a/docs/tutorials/wiki/src/authorization/.coveragerc +++ b/docs/tutorials/wiki/src/authorization/.coveragerc @@ -1,3 +1,2 @@ [run] source = tutorial -omit = tutorial/test* diff --git a/docs/tutorials/wiki/src/basiclayout/.coveragerc b/docs/tutorials/wiki/src/basiclayout/.coveragerc index a1d87d03d..5db0e79cf 100644 --- a/docs/tutorials/wiki/src/basiclayout/.coveragerc +++ b/docs/tutorials/wiki/src/basiclayout/.coveragerc @@ -1,3 +1,2 @@ [run] source = tutorial -omit = tutorial/test* diff --git a/docs/tutorials/wiki/src/installation/.coveragerc b/docs/tutorials/wiki/src/installation/.coveragerc index a1d87d03d..5db0e79cf 100644 --- a/docs/tutorials/wiki/src/installation/.coveragerc +++ b/docs/tutorials/wiki/src/installation/.coveragerc @@ -1,3 +1,2 @@ [run] source = tutorial -omit = tutorial/test* diff --git a/docs/tutorials/wiki/src/models/.coveragerc b/docs/tutorials/wiki/src/models/.coveragerc index a1d87d03d..5db0e79cf 100644 --- a/docs/tutorials/wiki/src/models/.coveragerc +++ b/docs/tutorials/wiki/src/models/.coveragerc @@ -1,3 +1,2 @@ [run] source = tutorial -omit = tutorial/test* diff --git a/docs/tutorials/wiki/src/tests/.coveragerc b/docs/tutorials/wiki/src/tests/.coveragerc index a1d87d03d..5db0e79cf 100644 --- a/docs/tutorials/wiki/src/tests/.coveragerc +++ b/docs/tutorials/wiki/src/tests/.coveragerc @@ -1,3 +1,2 @@ [run] source = tutorial -omit = tutorial/test* diff --git a/docs/tutorials/wiki/src/views/.coveragerc b/docs/tutorials/wiki/src/views/.coveragerc index a1d87d03d..5db0e79cf 100644 --- a/docs/tutorials/wiki/src/views/.coveragerc +++ b/docs/tutorials/wiki/src/views/.coveragerc @@ -1,3 +1,2 @@ [run] source = tutorial -omit = tutorial/test* -- cgit v1.2.3 From b349c2ba948148d2f5441308c6646f624100b364 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Fri, 3 Jan 2020 22:59:27 -0600 Subject: exclude tests package from source packages --- docs/tutorials/wiki/src/authorization/setup.py | 2 +- docs/tutorials/wiki/src/basiclayout/setup.py | 2 +- docs/tutorials/wiki/src/installation/setup.py | 2 +- docs/tutorials/wiki/src/models/setup.py | 2 +- docs/tutorials/wiki/src/tests/setup.py | 2 +- docs/tutorials/wiki/src/views/setup.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/tutorials/wiki') diff --git a/docs/tutorials/wiki/src/authorization/setup.py b/docs/tutorials/wiki/src/authorization/setup.py index fa5948acb..f19d643e6 100644 --- a/docs/tutorials/wiki/src/authorization/setup.py +++ b/docs/tutorials/wiki/src/authorization/setup.py @@ -44,7 +44,7 @@ setup( author_email='', url='', keywords='web pyramid pylons', - packages=find_packages(), + packages=find_packages(exclude=['tests']), include_package_data=True, zip_safe=False, extras_require={ diff --git a/docs/tutorials/wiki/src/basiclayout/setup.py b/docs/tutorials/wiki/src/basiclayout/setup.py index d6d488ed2..f85780010 100644 --- a/docs/tutorials/wiki/src/basiclayout/setup.py +++ b/docs/tutorials/wiki/src/basiclayout/setup.py @@ -42,7 +42,7 @@ setup( author_email='', url='', keywords='web pyramid pylons', - packages=find_packages(), + packages=find_packages(exclude=['tests']), include_package_data=True, zip_safe=False, extras_require={ diff --git a/docs/tutorials/wiki/src/installation/setup.py b/docs/tutorials/wiki/src/installation/setup.py index d6d488ed2..f85780010 100644 --- a/docs/tutorials/wiki/src/installation/setup.py +++ b/docs/tutorials/wiki/src/installation/setup.py @@ -42,7 +42,7 @@ setup( author_email='', url='', keywords='web pyramid pylons', - packages=find_packages(), + packages=find_packages(exclude=['tests']), include_package_data=True, zip_safe=False, extras_require={ diff --git a/docs/tutorials/wiki/src/models/setup.py b/docs/tutorials/wiki/src/models/setup.py index d6d488ed2..f85780010 100644 --- a/docs/tutorials/wiki/src/models/setup.py +++ b/docs/tutorials/wiki/src/models/setup.py @@ -42,7 +42,7 @@ setup( author_email='', url='', keywords='web pyramid pylons', - packages=find_packages(), + packages=find_packages(exclude=['tests']), include_package_data=True, zip_safe=False, extras_require={ diff --git a/docs/tutorials/wiki/src/tests/setup.py b/docs/tutorials/wiki/src/tests/setup.py index fa5948acb..f19d643e6 100644 --- a/docs/tutorials/wiki/src/tests/setup.py +++ b/docs/tutorials/wiki/src/tests/setup.py @@ -44,7 +44,7 @@ setup( author_email='', url='', keywords='web pyramid pylons', - packages=find_packages(), + packages=find_packages(exclude=['tests']), include_package_data=True, zip_safe=False, extras_require={ diff --git a/docs/tutorials/wiki/src/views/setup.py b/docs/tutorials/wiki/src/views/setup.py index 6f3cae397..439bb7759 100644 --- a/docs/tutorials/wiki/src/views/setup.py +++ b/docs/tutorials/wiki/src/views/setup.py @@ -43,7 +43,7 @@ setup( author_email='', url='', keywords='web pyramid pylons', - packages=find_packages(), + packages=find_packages(exclude=['tests']), include_package_data=True, zip_safe=False, extras_require={ -- cgit v1.2.3