diff options
| author | Chris McDonough <chrism@plope.com> | 2011-01-12 02:36:10 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-01-12 02:36:10 -0500 |
| commit | f52d595bd1cef5cb97d440c8ba1b1a9850ec8f4b (patch) | |
| tree | 054365e174f8707b2bf3d36906e718bbfcbf32de /docs/tutorials/wiki2/src/authorization | |
| parent | 57d300f292b87b67163399db9377fb2920621bd3 (diff) | |
| download | pyramid-f52d595bd1cef5cb97d440c8ba1b1a9850ec8f4b.tar.gz pyramid-f52d595bd1cef5cb97d440c8ba1b1a9850ec8f4b.tar.bz2 pyramid-f52d595bd1cef5cb97d440c8ba1b1a9850ec8f4b.zip | |
Features
--------
- ``pyramid.testing.setUp`` and ``pyramid.testing.tearDown`` have been
undeprecated. They are now the canonical setup and teardown APIs for test
configuration, replacing "direct" creation of a Configurator. This is a
change designed to provide a facade that will protect against any future
Configurator deprecations.
Paster Templates
----------------
- All paster templates now use ``pyramid.testing.setUp`` and
``pyramid.testing.tearDown`` rather than creating a Configurator "by hand"
within their ``tests.py`` module, as per decision in features above.
Documentation
-------------
- The wiki and wiki2 tutorials now use ``pyramid.testing.setUp`` and
``pyramid.testing.tearDown`` rather than creating a Configurator "by hand",
as per decision in features above.
- The "Testing" narrative chapter now explains ``pyramid.testing.setUp`` and
``pyramid.testing.tearDown`` instead of Configurator creation and
``Configurator.begin()`` and ``Configurator.end()``.
Diffstat (limited to 'docs/tutorials/wiki2/src/authorization')
| -rw-r--r-- | docs/tutorials/wiki2/src/authorization/tutorial/tests.py | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/docs/tutorials/wiki2/src/authorization/tutorial/tests.py b/docs/tutorials/wiki2/src/authorization/tutorial/tests.py index 1020a8b99..08916f43c 100644 --- a/docs/tutorials/wiki2/src/authorization/tutorial/tests.py +++ b/docs/tutorials/wiki2/src/authorization/tutorial/tests.py @@ -1,6 +1,5 @@ import unittest -from pyramid.config import Configurator from pyramid import testing def _initTestingDB(): @@ -20,11 +19,10 @@ def _registerRoutes(config): class ViewWikiTests(unittest.TestCase): def setUp(self): - self.config = Configurator(autocommit=True) - self.config.begin() + self.config = testing.setUp() def tearDown(self): - self.config.end() + testing.tearDown() def test_it(self): from tutorial.views import view_wiki @@ -36,12 +34,10 @@ class ViewWikiTests(unittest.TestCase): class ViewPageTests(unittest.TestCase): def setUp(self): self.session = _initTestingDB() - self.config = Configurator(autocommit=True) - self.config.begin() + self.config = testing.setUp() def tearDown(self): - self.session.remove() - self.config.end() + testing.tearDown() def _callFUT(self, request): from tutorial.views import view_page @@ -71,12 +67,11 @@ class ViewPageTests(unittest.TestCase): class AddPageTests(unittest.TestCase): def setUp(self): self.session = _initTestingDB() - self.config = Configurator(autocommit=True) - self.config.begin() + self.config = testing.setUp() def tearDown(self): self.session.remove() - self.config.end() + testing.tearDown() def _callFUT(self, request): from tutorial.views import add_page @@ -104,12 +99,11 @@ class AddPageTests(unittest.TestCase): class EditPageTests(unittest.TestCase): def setUp(self): self.session = _initTestingDB() - self.config = Configurator(autocommit=True) - self.config.begin() + self.config = testing.setUp() def tearDown(self): self.session.remove() - self.config.end() + testing.tearDown() def _callFUT(self, request): from tutorial.views import edit_page |
