Permalink
Browse files

[svn] updating references to the legacy API

--HG--
branch : trunk
  • Loading branch information...
1 parent b50454d commit cbf256848db29dbd258a4d82cdef503851da371c pjenvey committed Jul 27, 2006
Showing with 6 additions and 6 deletions.
  1. +4 −4 docs/interactive_debugger.txt
  2. +2 −2 docs/testing_web_application.txt
View
8 docs/interactive_debugger.txt
@@ -31,17 +31,17 @@ To trigger an error so that we can explore what's happening just raise an except
class DocsController(BaseController):
def view(self, url):
if request.path_info.endswith('docs'):
- h.redirect_to('/docs/')
- m.subexec('/docs/' + url)
+ redirect_to('/docs/')
+ return render_response('/docs/' + url)
Since we want to explore the ``session`` and ``request``, we'll need to bind them first. Here's what our action now looks like with the binding and raising an exception::
def view(self, url):
self._attach_locals()
raise "hi"
if request.path_info.endswith('docs'):
- h.redirect_to('/docs/')
- m.subexec('/docs/' + url)
+ redirect_to('/docs/')
+ return render_response('/docs/' + url)
Here's what exploring the Traceback from the above example looks like (Excerpt of the relevant portion):
View
4 docs/testing_web_application.txt
@@ -52,12 +52,12 @@ Modify the ``testexample/controllers/comments.py`` file so it looks like this::
class CommentsController(BaseController):
def index(self):
- m.write('Basic output')
+ return Response('Basic output')
def sess(self):
session['name'] = 'Joe Smith'
session.save()
- m.write('Saved a session')
+ return Response('Saved a session')
Then write a basic set of tests to ensure that the controller actions are functioning properly, modify ``testexample/tests/functions/test_comments.py`` to match the following::

0 comments on commit cbf2568

Please sign in to comment.