eventcally/doc/development.md
Daniel Grams 273b3fb072 Internal/analysis (#4)
* Codestyle Black

* Flake8

* Test coverage
2020-11-13 23:05:39 +01:00

59 lines
974 B
Markdown

# Development
## Tests
### Create test database
```sh
psql -c 'create database gsevpt_tests;' -U postgres
psql -c 'create extension postgis;' -d gsevpt_tests -U postgres
```
### Run tests
```sh
pytest
```
With coverage:
```sh
pytest --cov-report=html --cov=project
```
## Database
### Create new revision
```sh
python manage.py db migrate
```
### Upgrade database
```sh
python manage.py db upgrade
```
## i18n
<https://pythonhosted.org/Flask-BabelEx/>
### Init
```sh
pybabel extract -F babel.cfg -o messages.pot . && pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot . && pybabel init -i messages.pot -d app/translations -l de
```
### Extract new msgid's and merge into *.po files
```sh
pybabel extract -F babel.cfg -o messages.pot . && pybabel extract -F babel.cfg -k lazy_gettext -o messages.pot . && pybabel update -i messages.pot -d app/translations
```
#### Compile after translation is done
```sh
pybabel compile -d app/translations
```