Revision 355359bb
Added by Mikaël Ates over 12 years ago
calebasse/facturation/tests.py | ||
---|---|---|
14 | 14 |
from calebasse.ressources.models import ActType, Service, WorkerType |
15 | 15 |
from calebasse.personnes.models import Worker |
16 | 16 |
|
17 |
from list_acts import list_acts_for_billing_CAMSP |
|
17 |
from list_acts import list_acts_for_billing_CAMSP, \ |
|
18 |
list_acts_for_billing_SESSAD |
|
18 | 19 |
|
19 | 20 |
|
20 | 21 |
class FacturationTest(TestCase): |
... | ... | |
134 | 135 |
self.assertTrue(act9 in acts_rejected) |
135 | 136 |
self.assertTrue(act10 in acts_rejected) |
136 | 137 |
self.assertTrue(act11 in selected[patient_b]) |
138 |
|
|
139 |
def test_facturation_sessad(self): |
|
140 |
service_sessad = Service.objects.create(name='SESSAD') |
|
141 |
|
|
142 |
patient_a = create_patient('a', 'A', service_sessad, self.creator, date_selected=datetime(2020, 10, 5)) |
|
143 |
act0 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3], |
|
144 |
self.act_type, service_sessad, start_datetime=datetime(2020, 10, 6, 10, 15), |
|
145 |
end_datetime=datetime(2020, 10, 6, 12, 20)) |
|
146 |
patient_a.set_state('SESSAD_STATE_TRAITEMENT', self.creator, date_selected=datetime(2020, 10, 7)) |
|
147 |
act1 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3], |
|
148 |
self.act_type, service_sessad, start_datetime=datetime(2020, 10, 7, 10, 15), |
|
149 |
end_datetime=datetime(2020, 10, 7, 12, 20)) |
|
150 |
act2 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3], |
|
151 |
self.act_type, service_sessad, start_datetime=datetime(2020, 10, 7, 14, 15), |
|
152 |
end_datetime=datetime(2020, 10, 7, 16, 20)) |
|
153 |
act3 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3], |
|
154 |
self.act_type, service_sessad, start_datetime=datetime(2020, 10, 7, 16, 20), |
|
155 |
end_datetime=datetime(2020, 10, 7, 17, 20)) |
|
156 |
patient_a.set_state('SESSAD_STATE_CLOS', self.creator, date_selected=datetime(2020, 10, 8)) |
|
157 |
act4 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3], |
|
158 |
self.act_type, service_sessad, start_datetime=datetime(2020, 10, 8, 10, 15), |
|
159 |
end_datetime=datetime(2020, 10, 8, 12, 20)) |
|
160 |
|
|
161 |
automated_validation(datetime(2020, 10, 6), service_sessad, self.creator) |
|
162 |
automated_validation(datetime(2020, 10, 7), service_sessad, self.creator) |
|
163 |
automated_validation(datetime(2020, 10, 8), service_sessad, self.creator) |
|
164 |
|
|
165 |
not_locked, days_not_locked, not_valide, not_billable, rejected, missing_valid_notification, selected = \ |
|
166 |
list_acts_for_billing_SESSAD(datetime(2020, 10, 4), datetime(2020, 10, 8), service_sessad) |
|
167 |
self.assertEqual(not_locked, {}) |
|
168 |
self.assertEqual(not_valide, {}) |
|
169 |
self.assertEqual(not_billable, {}) |
|
170 |
self.assertEqual(len(rejected[patient_a]), 2) |
|
171 |
self.assertEqual(len(missing_valid_notification[patient_a]), 3) |
|
172 |
self.assertEqual(selected, {}) |
|
173 |
|
|
174 |
SessadHealthCareNotification(patient=patient_a, author=self.creator, start_date=datetime(2020,10,7), end_date=datetime(2021,10,6)).save() |
|
175 |
not_locked, days_not_locked, not_valide, not_billable, rejected, missing_valid_notification, selected = \ |
|
176 |
list_acts_for_billing_SESSAD(datetime(2020, 10, 4), datetime(2020, 10, 8), service_sessad) |
|
177 |
self.assertEqual(not_locked, {}) |
|
178 |
self.assertEqual(not_valide, {}) |
|
179 |
self.assertEqual(not_billable, {}) |
|
180 |
self.assertEqual(len(rejected[patient_a]), 2) |
|
181 |
self.assertEqual(missing_valid_notification, {}) |
|
182 |
self.assertEqual(len(selected[patient_a]), 3) |
Also available in: Unified diff
facturation: Add test for the act list for billing at the SESSAD.