Testing in Plone
This Tutorial applies to:
Plone 3.0.x
This Tutorial is intended for:
Developers
optilude
All content on one page (useful for printing, presentation mode etc.)
- Introduction What is this thing called testing anyway?
- A brief example Just so that you know what we're talking about
- Types of tests Some terminology you should be familiar with
- Telling stories with doctests Doctests bring code and test closer together, and makes it easier to describe what a test does, and why.
- Running tests It is not much good writing a test or relying on someone else's tests if you don't know how to run them.
- Writing unit tests Now that you understand the principle of tests and how to run them, it's time to write some. We will start with simple unit tests using doctest syntax.
- Testing a Zope 3 component with a separate doctest file Sometimes, we may need to perform additional set-up for our tests to run properly.
- Writing a PloneTestCase unit/integration test Sometimes, we need access to a full-blown Plone instance in order to effectively write tests
- Integration doctests using PloneTestCase The PloneTestCase integration test setup can also be used in doctests
- Functional and system tests with zope.testbrowser Whilst unit tests and doctests verify the correctness of individual methods and modules, functional tests test portions of the application as a whole, often from the point of view of the user, and typically aligned with use cases. System tests, in comparison, test the entire application as a black box.
- Using zope.testrecorder to record functional tests The zope.testrecorder product brings us full-circle: functional tests are recorded from within the browser, and saved to a runnable test.
- Determining the Code Coverage of your Test Suite Explanation for how to use the Zope test runner's built in code coverage features to prove the quality of your test suite.
- Testing examples Here, we list a few packages and projects that demonstrate good test coverage