Skip to content

Commit 72bebff

Browse files
committed
Add instructions on building the GMN DB fixture
1 parent ae897d2 commit 72bebff

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,17 @@ The GMN tests run in the context of a database that has been prepopulated with r
180180

181181
./test_utilities/src/d1_test/test_docs/db_fixture_gmn1.gz
182182

183+
Set up a blank database to be populated with test data:
184+
185+
$ sudo -u postgres dropdb --if-exists gmn_test_db_template
186+
$ sudo -u postgres createdb -E UTF8 --owner=<your user name> gmn_test_db_template
187+
$ ./gmn/src/d1_gmn/manage.py migrate --settings settings_test --database template --run-syncdb
188+
183189
Regenerate the fixture file:
184190

185-
$ ./d1_python/gmn/src/d1_gmn/tests/mk_db_fixture.py
191+
$ ./gmn/src/d1_gmn/tests/mk_db_fixture.py
192+
193+
The name, `gmn_test_db_template`, must match the name of the database that is set up for the dict key `template` in `settings_test.DATABASE`.
186194

187195
After changing any of the ORM classes in models.py, the database test fixture must be regenerated. This will often cause sample files to have to be updated as well.
188196

0 commit comments

Comments
 (0)