diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-02-21 17:04:57 +0000 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-02-21 17:04:57 +0000 |
commit | 3b2a8ac12c8b0303ebecf277f975449e8e560ec9 (patch) | |
tree | 6e5f6b7a30a1ebee9206a3df2cfd143125b2355c /ctrack/organisations | |
parent | abd22b0143661370aa29246d21389d5f0bf7abc3 (diff) |
populate script now does EngagementEvent objects
Diffstat (limited to 'ctrack/organisations')
-rw-r--r-- | ctrack/organisations/management/commands/populate_db.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py index 4477b63..1674ec0 100644 --- a/ctrack/organisations/management/commands/populate_db.py +++ b/ctrack/organisations/management/commands/populate_db.py @@ -11,6 +11,7 @@ from ctrack.organisations.tests.factories import OrganisationFactory from ctrack.organisations.tests.factories import PersonFactory from ctrack.organisations.tests.factories import RoleFactory from ctrack.organisations.tests.factories import UserFactory +from ctrack.register.tests.factories import EngagementEventFactory class Command(BaseCommand): @@ -71,3 +72,30 @@ class Command(BaseCommand): f"Created {number} Person object[s]! Go forth and multiply." ) ) + + # set up some EngagementEvents + + p1 = PersonFactory.create( + role=role, + updated_by=user, + predecessor=None, + organisation__submode=submodes[randint(0, len(submodes) - 1)], + organisation=org, + ) + p2 = PersonFactory.create( + role=role, + updated_by=user, + predecessor=None, + organisation__submode=submodes[randint(0, len(submodes) - 1)], + organisation=org, + ) + p3 = PersonFactory.create( + role=role, + updated_by=user, + predecessor=None, + organisation__submode=submodes[randint(0, len(submodes) - 1)], + organisation=org, + ) + + ee1 = EngagementEventFactory.create(user=user, participants=[p1, p2]) + ee2 = EngagementEventFactory.create(user=user, participants=[p3]) |