-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Plone 3 Products Development Cookbook
When working with portlets, we can test two things:
Whether the portlet is correctly installed and ready to be used
Whether the portlet shows what we wanted under the expected conditions
Fortunately, paster creates a test suite with these two test cases. Given that it can't know what we want to show in any portlet (paster magic doesn't cover Divination, a rather fuzzy discipline), there's a part that we must complete: the test_render method in the test_portlet module.
If we have a look at test_portlet in the pox.portlet.banner.tests package, we'll find something that we haven't seen in this book so far: a PyUnit test.
We have already talked about our favorite testing approach (doctest), so we won't give more details here. Nevertheless, paster has done a very good job so we don't need to reinvent the wheel. Let's see our render test.
Update the afterSetup method: Open the test_portlet.py file in tests sub-package and modify the afterSetup method in the TestRenderer...
Change the font size
Change margin width
Change background colour