forked from adamlaska/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump-to-names-json
More file actions
16 lines (14 loc) · 846 Bytes
/
dump-to-names-json
File metadata and controls
16 lines (14 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
# This script provides a limited selected dump of database content with the
# purpose of generating a test fixture that provides the test data needed
# by the test suite.
#
# The generated data fixture is sorted and normalized in order to produce
# minimal commit diffs which reflect only actual changes in the fixture data,
# without apparent changes resulting only from ordering changes.
set -x
ietf/manage.py dumpdata --indent 1 doc.State doc.BallotType doc.StateType \
mailtrigger.MailTrigger mailtrigger.Recipient name utils.VersionInfo \
group.GroupFeatures stats.CountryAlias dbtemplate.DBTemplate \
| jq --sort-keys "sort_by(.model, .pk)" \
| jq '[.[] | select(.model!="dbtemplate.dbtemplate" or .pk==354)]' > ietf/name/fixtures/names.json