Testing the application - wonjoonSeol/ScienceScape GitHub Wiki

Testing ScienceScapeS

Our application is heavily tested, to make sure components work well and interact together in a satisfactory way.

To test the website, the simplest way is to run the following script from your command line.

./test.sh python3 both

This will run tests for the front-end, then tests for the back-end, and show coverage for front-end files.  To test only part of the application, please run one (or both) of:

./test.sh python3 frontend

./test.sh python3 backend Please note that running the latter will not show coverage for the back-end code, it is therefore normal that the coverage appear to be lower on screen. Rest assured our back-end is just as heavily tested as the front-end. The reason for this is that the back-end is used by the application, but is not part of it Django-wise since it has to be reusable as a standalone set of scripts for extensibility.

Our test files

Our test files are located in the tests/ directory of our application, and are separated in two subfolders: tests_bibliotools (back-end) and tests_front_end (front-end).

In case the given shell scripts do not work on your machine, please run the following:

python3 manage.py test tests/ --with-coverage --settings=mysite.settings.local

Again, this shows coverage for the front-end only, since the back-end is used by the application, but is not part of the application since it has to be reusable as a standalone set of scripts.