Refactor fixtures from JSON to Python

This commit is contained in:
Seamus Johnston 2022-12-21 10:05:03 -06:00
parent ba7c0b9e8d
commit df265b10f8
No known key found for this signature in database
GPG key ID: 2F21225985069105
10 changed files with 426 additions and 270 deletions

View file

@ -38,6 +38,12 @@ If you run via `docker-compose up -d`, you can get logs with `docker-compose log
You can change the logging verbosity, if needed. Do a web search for "django log level".
## Mock data
There is a `post_migrate` signal in [signals.py](../../src/registrar/signals.py) that will load the fixtures from [fixtures.py](../../src/registrar/fixtures.py), giving you some test data to play with while developing.
See the [database-access README](./database-access.md) for information on how to pull data to update these fixtures.
## Running tests
Crash course on Docker's `run` vs `exec`: in order to run the tests inside of a container, a container must be running. If you already have a container running, you can use `exec`. If you do not, you can use `run`, which will attempt to start one.

View file

@ -24,7 +24,7 @@ cf run-task getgov-unstable --command 'python manage.py migrate' --name migrate
Optionally, load data from fixtures as well
```shell
cf run-task getgov-unstable --wait --command 'python manage.py loaddata registrar/fixtures/*' --name loaddata
cf run-task getgov-unstable --wait --command 'python manage.py load' --name loaddata
```
For the `staging` environment, developers don't have credentials so we need to