-
Notifications
You must be signed in to change notification settings - Fork 12
Unit tests
When making a change to Signbank, a lot of things can go wrong. The idea of our test suite is that we can quickly test for an installation if all basic functionality is still working.
We have a tests.py
file for each application. You can run them all with:
python bin/develop.py test -k
To run only an individual group of tests
python bin/develop.py test -k signbank.dictionary.tests.BasicCRUDTests
To create a fresh small test database based on your current database:
python repo/signbank/create_test_db.py
Test databases should be small, because the Django testing framework puts everything in one JSON string, which takes several minutes on the full database.
Tests whether you can create, read, update and delete glosses. The RUD part is done using the same requests that are run when doing it pushing buttons in the interface.
Also tests whether you can create glosses, using the same requests that are run when pushing buttons in the interface.
Checks if the search functionality returns the correct things.
Confirms you can only create an export of a dataset when you have the correct permissions for that dataset
Confirms you cannot export a dataset when you have no permission
Confirms you cannot export a dataset when you are not logged in
Checks whether a CSV is returned when you export one
Checks whether you can add and remove videos.
Checks whether the AJAX gloss suggestion helper functionality is still working
Makes sure that the detail view gives a 200 (possibly empty if you don't have the dataset permissions)
Verifies that a few characters combinations are not part of the Javascript