-
Notifications
You must be signed in to change notification settings - Fork 23
Add test data
This is a step by step guide on how to add test data for development and testing.
Add a new Theme in an existing PLR
-
in https://github.com/openoereb/pyramid_oereb/tree/master/sample_data/plr119 add a new folder with the name of the theme. Ideally this folder contains all the files needed for a theme, the easiest is probably to copy them from an existing theme and adapt them. Below is a list of files needed:
- availabilities.json -> in this file you determine whether the theme contains data or not.
- data_integration.json
- document.json
- document_reference.json
- geometry.json -> Make sure the geometry.json contains the correct geometry as described in the config.yaml
- legend_entry.json
- office.json
- public_law_restriction.json
- public_law_restriction_document.json
- view_service.json
-
In the Makefile complete the rule
test-db/13-fill.sql
such that the json file in the newly created folder are also red to when13-fill.sql
is created. Add the following line and adapt the path if needed:... \ $(shell ls -1 sample_data/plr119/<new_theme_name>/*.json)
-
Include the theme when loading the schemas in pyramid_oereb/standard/load_sample_data.py
... def load: """ Performs the database operations to load the sample data. """ from ... <new_theme_name> ... try: for schema, folder in [ ... (<new_theme_name>, "<new_theme_name>"), ]: ...
-
Remove the DB docker container, clean the old SQL files and serve the application.