Skip to content

Commit b196542

Browse files
committed
Added a utility script to dump a normalized names.json fixture
- Legacy-Id: 17775
1 parent 9a72f1b commit b196542

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

bin/dump-to-names-json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# This script provides a limited selected dump of database content with the
4+
# purpose of generating a test fixture that provides the test data needed
5+
# by the test suite.
6+
#
7+
# The generated data fixture is sorted and normalized in order to produce
8+
# minimal commit diffs which reflect only actual changes in the fixture data,
9+
# without apparent changes resulting only from ordering changes.
10+
11+
set -x
12+
ietf/manage.py dumpdata --indent 1 doc.State doc.BallotType doc.StateType \
13+
mailtrigger.MailTrigger mailtrigger.Recipient name utils.VersionInfo \
14+
group.GroupFeatures stats.CountryAlias dbtemplate.DBTemplate \
15+
| jq --sort-keys "sort_by(.model, .pk)" \
16+
| jq '[.[] | select(.model!="dbtemplate.dbtemplate" or .pk==354)]' > ietf/name/fixtures/names.json

0 commit comments

Comments
 (0)