summaryrefslogtreecommitdiff
path: root/docs/narr/unittesting.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2010-10-25 21:41:46 -0400
committerChris McDonough <chrism@plope.com>2010-10-25 21:41:46 -0400
commiteaaa8855d88eedb2ad4fef435e7473022504485e (patch)
tree90a1e05181c607431935d81c5dabf7421d0969f3 /docs/narr/unittesting.rst
parent7c697c55324a1624c013e1285734aa687964d690 (diff)
downloadpyramid-eaaa8855d88eedb2ad4fef435e7473022504485e.tar.gz
pyramid-eaaa8855d88eedb2ad4fef435e7473022504485e.tar.bz2
pyramid-eaaa8855d88eedb2ad4fef435e7473022504485e.zip
convert more docs from bfg to pyramid
Diffstat (limited to 'docs/narr/unittesting.rst')
-rw-r--r--docs/narr/unittesting.rst8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/narr/unittesting.rst b/docs/narr/unittesting.rst
index d6f854187..85f74ec0a 100644
--- a/docs/narr/unittesting.rst
+++ b/docs/narr/unittesting.rst
@@ -226,14 +226,14 @@ used the testing API.
def test_view_fn_not_submitted(self):
from my.package import view_fn
- renderer = self.config.testing_add_template('templates/show.pt')
+ renderer = self.config.testing_add_renderer('templates/show.pt')
request = testing.DummyRequest()
response = view_fn(request)
renderer.assert_(say='Hello')
def test_view_fn_submitted(self):
from my.package import view_fn
- renderer = self.config.testing_add_template(
+ renderer = self.config.testing_add_renderer(
'templates/submitted.pt')
request = testing.DummyRequest()
request.params['say'] = 'Yo'
@@ -249,7 +249,7 @@ The first test method, ``test_view_fn_not_submitted`` tests the
``view_fn`` function in the case that no "form" values (represented by
request.params) have been submitted. Its first line registers a
"dummy template renderer" named ``templates/show.pt`` via the
-:meth:`pyramid.configuration.Configurator.testing_add_template`
+:meth:`pyramid.configuration.Configurator.testing_add_renderer`
method; this method returns a
:class:`pyramid.testing.DummyTemplateRenderer` instance which we
hang on to for later.
@@ -367,7 +367,7 @@ environment.
str(len(body))))
Unless you cannot avoid it, you should prefer writing unit tests that
-use the :class:`pyramid.configuration,Configurator` API to set up
+use the :class:`pyramid.configuration.Configurator` API to set up
the right "mock" registrations rather than creating an integration
test. Unit tests will run faster (because they do less for each test)
and the result of a unit test is usually easier to make assertions