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

Chapter 19. Events and Subscribers > Step 6: Testing the Message Mailer

Step 6: Testing the Message Mailer

So far in Part III, you have not written any complicated tests. That changes now. First of all, you have to bring up quite a bit more of the Zope 3 framework to do the tests. The test_message.py module's setUp() function needs to register the location adapters and the message mail subscription adapter. So it should look like this:

01 from zope.app.location.traversing import LocationPhysicallyLocatable
02 from zope.app.location.interfaces import ILocation
03 from zope.app.traversing.interfaces import IPhysicallyLocatable
04 
05 from book.messageboard.interfaces import IMailSubscriptions
06 from book.messageboard.interfaces import IMessage
07 from book.messageboard.message import MailSubscriptions
08 
09 def setUp(test):
10     ...
11     ztapi.provideAdapter(ILocation, IPhysicallyLocatable,
12                          LocationPhysicallyLocatable)
13     ztapi.provideAdapter(IMessage, IMailSubscriptions, MailSubscriptions)


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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