General explanation
Each openIMIS module can provide scripts that automatically generate data to fill a test database. This page details how the main ones can be used.
Insuree module
The insuree module has a custom Django command generateinsurees
that can generate any number of insurees, with their family and an optional active policy.
Syntax
The command syntax is the following:
generateinsurees <number_of_families> <number_of_members_in_each_family> [--policy] [--verbose] [--locale=<locale_name>]
<number_of_families>: the number of families that must be generated. Mandatory.
<number_of_members_in_each_family>: the number of extra family members - on top of the family head - that should be added to the existing family. Mandatory.
[--policy]: (optional) creates an active policy for this family.
[--verbose]: (optional) writes in the standard output what the script is doing.
[--locale=<locale_name>]: (optional) creates insurees with names that sound like typical names from the country represented by <locale_name>. The list of availables locales is available here. ⚠️ A locale can only be used if the
faker.providers.person
entry is present in the list.
Example
openimis-be_py/openIMIS (openimis-venv) ❯ python manage.py generateinsurees 4 2 --policy --locale=fr_BE
The above command will generate 4 families of 3 members (2 + 1), with an active policy, with Belgian French names.