Check test.example package. Everything necessary should be there.
Test data are in test/data
folder.
If your test data contains special characters like čřšáý and so on, it is recommended
to make .stripped
variation of the file.
E.g. my_format.json
and my_format.stripped.json
for loading data
and my_format.test.xml
and my_format.test.stripped.xml
for testing.
If not on dev-5 (e.g. when run on localhost), .stripped
version of files will be loaded.
The reason for this is, that when dspace runs on windows, it has trouble with special characters.
See const.py for constants used at testing.
To set up logs, navigate to support.logs.py and modify method set_up_logging.
In order to run tests, use command
python -m unittest
Recommended variation is
python -m unittest -v 2> output.txt
which leaves result in output.txt
Before running for the first time, requirements must be installed with following command
pip install -r requirements.txt
It is possible to run in Pycharm with configuration like so:
Recreate your local CLARIN-DSpace7.* database NOTE: all data will be deleted
- Install again the database following the official tutorial steps: https://wiki.lyrasis.org/display/DSDOC7x/Installing+DSpace#InstallingDSpace-PostgreSQL11.x,12.xor13.x(withpgcryptoinstalled)
- Or try to run these commands in the <PSQL_PATH>/bin:
createdb --username=postgres --owner=dspace --encoding=UNICODE dspace
// create databasepsql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;"
// Add pgcrypto extensionIf it throws warning that
-c
parameter was ignored, just write aCREATE EXTENSION pgcrypto;
command in the database cmd. CREATE EXTENSION pgcrypto;