diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-11-08 21:10:56 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-11-08 21:10:56 +0000 |
| commit | eabf3b6fae0714f305f5786c042f19734293fb0c (patch) | |
| tree | feae103501e211b14daf2d107f2734bbeb10695f /docs/narr | |
| parent | 738f325de6fac3551691d07ad0293891fb352b4e (diff) | |
| download | pyramid-eabf3b6fae0714f305f5786c042f19734293fb0c.tar.gz pyramid-eabf3b6fae0714f305f5786c042f19734293fb0c.tar.bz2 pyramid-eabf3b6fae0714f305f5786c042f19734293fb0c.zip | |
registerTemplate -> registerDummyTemplate
Diffstat (limited to 'docs/narr')
| -rw-r--r-- | docs/narr/unittesting.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/narr/unittesting.rst b/docs/narr/unittesting.rst index eddae73d9..8724e4a87 100644 --- a/docs/narr/unittesting.rst +++ b/docs/narr/unittesting.rst @@ -31,14 +31,14 @@ classes. class MyTest(BFGTestCase): def test_view_fn_not_submitted(self): - template = self.registerTemplate('templates/show.pt') + template = self.registerDummyTemplate('templates/show.pt') request = self.makeRequest() context = self.makeModel() response = view_fn(context, request) self.assertEqual(template.say, 'Hello') def test_view_fn_submitted(self): - template = self.registerTemplate('templates/submitted.pt') + template = self.registerDummyTemplate('templates/submitted.pt') request = self.makeRequest() request.params['say'] = 'Yo' context = self.makeModel() @@ -49,8 +49,8 @@ In the above example, we create a ``MyTest`` test case that inherits from ``BFGTestCase``. It has two test methods. 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 "template" named -``templates/show.pt`` via the ``registerTemplate`` method (a +been submitted. Its first line registers a "dummy template" named +``templates/show.pt`` via the ``registerDummyTemplate`` method (a ``BFGTestCase`` API); this function returns a DummyTemplate instance which we hang on to for later. We then call ``makeRequest`` to get a DummyRequest object, and ``makeModel`` to get a DummyModel object. We |
