We use the py.test script in the root directory rather than the
one installed with py.test in PATH. We need it to set up the path
because we have many of the libraries in vendor/. Once we get
rid of vendor/ we can use the regular py.test script.

Before you run the tests, you have to run the collectstatic command. This
compiles LESS files to CSS files and creates the bundles that some of
the tests require to run. If you don’t do this, then a few of the
tests will fail.

To run collectstatic, do:

./manage.pycollectstatic

You don’t have to do this often. I’d do it the first time and then any
time you run the tests with a fresh db.

Code should be written so it can be tested, and then there should be
tests for it.

When adding code to an app, tests should be added in that app that
cover the new functionality. All apps have a tests module where
tests should go. They will be discovered automatically by the test
runner as long as the look like a test.

If you’re expecting reverse to return locales in the URL, use
LocalizingClient instead of the default client for the
TestCase class.

We use FactoryBoy to generate model instances instead of using fixtures.
fjord.feedback.tests.ResponseFactory generates
fjord.feedback.models.Response instances.

To add a smoketest, see the README.rst file in the smoketests/
directory.