Menu

Using GAE Testbed with GAEUnit: Testing that email was sent

In my quest for testing if emails are being sent by my app engine app, I came across GAE Testbed. GAE Testbed

… is a set of base test cases to make it simple to test the more complicated pieces of AppEngine’s framework (such as sending E-mail messages, the datastore, Memcache, etc.)

Since I’m already using GAEUnit as the unit testing framework for my app, I wanted to use GAE Testbed alongside GAEUnit so I only had to call one command (http://localhost:8080/test) to execute all my tests. The documentation from the GAE Testbed home page is written to make it work alongside NoseGAE, so I decided to write one for GAEUnit.

From the folder extracted from the archive, copy gaeunit.py to your app’s root folder.

Add the following 2 lines to your app.yaml, directly below the line that says handlers::

- url: /test.*
script: gaeunit.py

(Optional) From the folder extracted from the archive, there’s a folder named sample_app and inside it is the modified version of the webtest module. Copy the webtest module (the entire folder containing debugapp.py and __init__.py) to the root of your app.

Hi Kevin. I have never used NoseGAE, but from what i’ve read, NoseGAE requires the installation of some other packages, which I think makes it not very portable and doesn’t ensure that my app will work on other servers. What I like about GAEUnit is that you already know that it comes with your app when you deploy it.