Skip to content

Commit 9914375

Browse files
committed
add test data
in case the developer wants to populate the DB when running the apps locally
1 parent 3e7b828 commit 9914375

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ teardown:
4040
docker-compose -f ${COMPOSE_ENV}.yml down -v
4141

4242
recreate: teardown run
43+
44+
# DO NOT USE IT IN PRODUCTION as it wipes all the data
45+
load-test-data:
46+
docker-compose -f local.yml exec -T django python manage.py loaddata test_data.yaml
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
2+
- model: auth.User
3+
pk: 2
4+
fields:
5+
password: 123456
6+
last_login: null
7+
is_superuser: false
8+
9+
first_name: Sur
10+
last_name: Doctor
11+
12+
is_staff: false
13+
is_active: true
14+
date_joined: 2024-09-11T00:00:00Z
15+
16+
- model: auth.User
17+
pk: 3
18+
fields:
19+
password: 123456
20+
last_login: null
21+
is_superuser: false
22+
23+
first_name: Sur 2
24+
last_name: Doctor
25+
26+
is_staff: false
27+
is_active: true
28+
date_joined: 2024-09-11T00:00:00Z
29+
30+
- model: auth.User
31+
pk: 4
32+
fields:
33+
password: 123456
34+
last_login: null
35+
is_superuser: false
36+
37+
first_name: Sur 3
38+
last_name: Doctor
39+
40+
is_staff: false
41+
is_active: true
42+
date_joined: 2024-09-11T00:00:00Z
43+
44+
- model: users.MedicalPersonnel
45+
pk: 2
46+
fields:
47+
user_id: 2
48+
level: Lead Surgeon
49+
50+
- model: users.MedicalPersonnel
51+
pk: 3
52+
fields:
53+
user_id: 3
54+
level: Lead Surgeon
55+
56+
- model: users.MedicalPersonnel
57+
pk: 4
58+
fields:
59+
user_id: 4
60+
level: Lead Surgeon
61+
62+
- model: registry.Hospital
63+
pk: 10
64+
fields:
65+
name: Test Hospital
66+
address: Here and there Address
67+
68+
- model: registry.Hospital
69+
pk: 11
70+
fields:
71+
name: Different Hospital
72+
address: Nowhere
73+
74+
75+
- model: registry.Patient
76+
pk: 100
77+
fields:
78+
full_name: Patient Boy
79+
national_id: National Id
80+
day_of_birth: 18
81+
month_of_birth: 3
82+
year_of_birth: 2002
83+
gender: MALE
84+
phone_1: 0123456789
85+
phone_2: 9876543210
86+
address: All the way
87+
created_at: 2024-09-11
88+
updated_at: 2024-09-11
89+
90+
- model: registry.PatientHospitalMapping
91+
pk: 1000
92+
fields:
93+
patient_id: 100
94+
hospital_id: 10
95+
patient_hospital_id: 1100
96+
97+
- model: registry.Episode
98+
pk: 10000
99+
fields:
100+
patient_hospital_mapping: 1000
101+
created: 2024-09-11T00:00:00Z
102+
surgery_date: 2024-09-11T00:00:00Z
103+
episode_type: INGUINAL
104+
primary_surgeon_id: null
105+
secondary_surgeon_id: null
106+
tertiary_surgeon_id: null
107+
surgeons: [ 1, 2, 3, 4 ]
108+
cepod: PLANNED
109+
side: LEFT
110+
occurence: PRIMARY
111+
type: DIRECT
112+
size: VERY_SMALL
113+
complexity: SIMPLE
114+
mesh_type: TNMHP
115+
anaesthetic_type: LOCAL
116+
diathermy_used: false
117+
antibiotic_used: false
118+
antibiotic_type: null
119+
comments: Comment here
120+
121+
- model: registry.Episode
122+
pk: 10001
123+
fields:
124+
patient_hospital_mapping: 1000
125+
created: 2024-09-11T00:00:00Z
126+
surgery_date: 2024-09-11T00:00:00Z
127+
episode_type: INGUINAL
128+
primary_surgeon_id: null
129+
secondary_surgeon_id: null
130+
tertiary_surgeon_id: null
131+
surgeons: [ 1, 2 ]
132+
cepod: PLANNED
133+
side: LEFT
134+
occurence: PRIMARY
135+
type: DIRECT
136+
size: VERY_SMALL
137+
complexity: SIMPLE
138+
mesh_type: TNMHP
139+
anaesthetic_type: LOCAL
140+
diathermy_used: false
141+
antibiotic_used: false
142+
antibiotic_type: null
143+
comments: Comment here
144+
145+
- model: registry.Episode
146+
pk: 10002
147+
fields:
148+
patient_hospital_mapping: 1000
149+
created: 2024-09-11T00:00:00Z
150+
surgery_date: 2024-09-11T00:00:00Z
151+
episode_type: INGUINAL
152+
primary_surgeon_id: null
153+
secondary_surgeon_id: null
154+
tertiary_surgeon_id: null
155+
surgeons: []
156+
cepod: PLANNED
157+
side: LEFT
158+
occurence: PRIMARY
159+
type: DIRECT
160+
size: VERY_SMALL
161+
complexity: SIMPLE
162+
mesh_type: TNMHP
163+
anaesthetic_type: LOCAL
164+
diathermy_used: false
165+
antibiotic_used: false
166+
antibiotic_type: null
167+
comments: Comment here

0 commit comments

Comments
 (0)