We use FactoryBoy to generate model instances and test data.
To run the tests, make sure your virtual environment is activated and then:
You can see more options by doing:
Once you get a runline you like, put it in a bash script.
Tests go in directories like
We use Factory Boy
to generate model instances. Factory classes go in
Test modules should be named
Test classes should be named
Test* and should extend Django’s
Functions and methods should be named
Use the non-camel-case versions of
assertXyz and friends if they
See existing tests for examples.
We’re not shooting for 100% code coverage—only write tests that are compelling.
Make sure tests are documented and it’s clear what’s being tested and how.