• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 32. Exception Views > Step 3: Testing the Exception View

Step 3: Testing the Exception View

The easiest way to raise an exception is to write a simple view that does it. It could look something like this (in browser.py):

01 from book.exceptionview.interfaces import PaymentException
02
03 class RaiseExceptionView(object):
04     """The view that raises the exception"""
05
06     def raisePaymentException(self):
07         raise PaymentException, 'You are required to pay.'


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint