Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.99 KB

README.dev.md

File metadata and controls

46 lines (31 loc) · 1.99 KB

How to write new tests

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.

Settings

See const.py for constants used at testing.

To set up logs, navigate to support.logs.py and modify method set_up_logging.

Run

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:

image

How to re-initialize dspace 7 database

Recreate your local CLARIN-DSpace7.* database NOTE: all data will be deleted

  • createdb --username=postgres --owner=dspace --encoding=UNICODE dspace // create database
  • psql --username=postgres dspace -c "CREATE EXTENSION pgcrypto;" // Add pgcrypto extension

If it throws warning that -c parameter was ignored, just write a CREATE EXTENSION pgcrypto; command in the database cmd. CREATE EXTENSION pgcrypto; image