-
Notifications
You must be signed in to change notification settings - Fork 30
Writing tests
The system supports both unit tests and functional tests through selenium.
They are located in the root of the test folder. The unit tests should cover all model functions with both negative and positive tests. To populate the test database you can either create the data manually in the setUp function or you can use the factories to create data. Be aware that the factories do not live up to real world constraints, for instance a parent can be older than their child
For examples of unit tests see
- Test_dump_data uses factories.
- Test_model_address creates data inline.
Functional tests are located in a subfolder in the test directory. Start your functional test with a doctoring that outlines the flow of the tests. Use inline comments to describe the individual steps. Each test should end with writing a screenshot to disk, they make it easier to debug regressions.
You can use test_create_family as an example.