Skip to content

Commit

Permalink
Stop using generated_fixtures.py
Browse files Browse the repository at this point in the history
They were not used in tests, and the role of filling the database with
mock data can be handled by `create_fake_incidents`.
  • Loading branch information
hmpf committed Dec 16, 2020
1 parent efdc421 commit 8761dd3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 351 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,25 @@ Refer to the [tox.ini](tox.ini) file for further options.

### Mock data

#### Generating
Fill the database with mock data with the management command `create_fake_incidents`:

```sh
PYTHONPATH=src python src/argus/incident/fixtures/generate_fixtures.py
$ python manage.py create_fake_incidents
```

This creates the file `src/argus/incident/fixtures/incident/mock_data.json`.
See the inbuilt help for flags and toggles:

#### Loading
```sh
$ python manage.py create_fake_incidents --help
```

Since the current default number of shown incidents in the frintend is 10, you
might want to create just more than 10 incidents in one go, with the `-n`-flag:

```sh
python manage.py loaddata incident/mock_data
$ python manage.py create_fake_incidents -n 15
```

(The same command is well-suited to manually test the notification system: Make
a filter that matches fake incidents, for instance by setting `source` to
`argus`, and create a single fake incident by omitting the `-n`-flag.)
1 change: 0 additions & 1 deletion src/argus/incident/fixtures/.gitignore

This file was deleted.

Empty file.
316 changes: 0 additions & 316 deletions src/argus/incident/fixtures/generate_fixtures.py

This file was deleted.

29 changes: 0 additions & 29 deletions tests/incident/fixtures/test_incident_fixtures.py

This file was deleted.

0 comments on commit 8761dd3

Please sign in to comment.