Project

General

Profile

Download (22 KB) Statistics
| Branch: | Tag: | Revision:

calebasse / calebasse / facturation / tests.py @ 81066065

1
# -*- coding: utf-8 -*-
2
import time
3
from datetime import datetime, date
4
from dateutil import rrule
5
from dateutil.relativedelta import relativedelta
6

    
7
from django.test import TestCase
8
from django.contrib.auth.models import User
9

    
10
from calebasse.actes.validation import automated_validation, \
11
    are_all_acts_of_the_day_locked, \
12
    get_days_with_acts_not_locked
13
from calebasse.actes.models import EventAct
14
from calebasse.dossiers.models import create_patient, PatientRecord, \
15
    SessadHealthCareNotification, CmppHealthCareTreatment, CmppHealthCareDiagnostic
16
from calebasse.dossiers.models import Status
17
from calebasse.ressources.models import ActType, Service, WorkerType
18
from calebasse.personnes.models import Worker
19

    
20
from list_acts import (list_acts_for_billing_CAMSP,
21
    list_acts_for_billing_SESSAD, list_acts_for_billing_CMPP,
22
    list_acts_for_billing_CMPP_2)
23

    
24
from models import add_price, PricePerAct, Invoicing
25

    
26

    
27
class FacturationTest(TestCase):
28
    def setUp(self):
29
        self.creator = User.objects.create(username='John')
30

    
31
        self.wtype = WorkerType.objects.create(name='ElDoctor', intervene=True)
32
        self.therapist1 = Worker.objects.create(first_name='Bob', last_name='Leponge', type=self.wtype)
33
        self.therapist2 = Worker.objects.create(first_name='Jean', last_name='Valjean', type=self.wtype)
34
        self.therapist3 = Worker.objects.create(first_name='Pierre', last_name='PaulJacques', type=self.wtype)
35
        self.act_type = ActType.objects.create(name='trepanation')
36

    
37
    def test_facturation_camsp(self):
38
        service_camsp = Service.objects.get(name='CAMSP')
39

    
40
        patient_a = create_patient('a', 'A', service_camsp, self.creator, date_selected=datetime(2020, 10, 5))
41
        act0 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
42
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 6, 10, 15),
43
                end_datetime=datetime(2020, 10, 6, 12, 20))
44
        status_suivi = Status.objects.filter(services__name='CAMSP').filter(type='SUIVI')[0]
45
        patient_a.set_state(status_suivi, self.creator, date_selected=datetime(2020, 10, 7))
46
        act1 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
47
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 7, 10, 15),
48
                end_datetime=datetime(2020, 10, 7, 12, 20))
49
        act2 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
50
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 7, 14, 15),
51
                end_datetime=datetime(2020, 10, 7, 16, 20))
52
        act3 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
53
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 7, 16, 20),
54
                end_datetime=datetime(2020, 10, 7, 17, 20))
55
        status_clos = Status.objects.filter(services__name='CAMSP').filter(type='CLOS')[0]
56
        patient_a.set_state(status_clos, self.creator, date_selected=datetime(2020, 10, 8))
57
        act4 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
58
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 8, 10, 15),
59
                end_datetime=datetime(2020, 10, 8, 12, 20))
60

    
61
        patient_b = create_patient('b', 'B', service_camsp, self.creator, date_selected=datetime(2020, 10, 4))
62
        act5 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_b, [self.therapist3],
63
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 4, 10, 15),
64
                end_datetime=datetime(2020, 10, 4, 12, 20))
65
        act6 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_b, [self.therapist3],
66
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 5, 10, 15),
67
                end_datetime=datetime(2020, 10, 5, 12, 20))
68
        act6.set_state('ABS_EXC', self.creator)
69
        act7 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_b, [self.therapist3],
70
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 5, 10, 15),
71
                end_datetime=datetime(2020, 10, 5, 12, 20))
72
        act7.switch_billable = True
73
        act7.save()
74
        patient_b.set_state(status_suivi, self.creator, date_selected=datetime(2020, 10, 6))
75
        act8 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_b, [self.therapist3],
76
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 7, 10, 15),
77
                end_datetime=datetime(2020, 10, 7, 12, 20))
78
        act9 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_b, [self.therapist3],
79
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 7, 14, 15),
80
                end_datetime=datetime(2020, 10, 7, 16, 20))
81
        act10 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_b, [self.therapist3],
82
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 7, 16, 20),
83
                end_datetime=datetime(2020, 10, 7, 17, 20))
84
        act11 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_b, [self.therapist3],
85
                self.act_type, service_camsp, start_datetime=datetime(2020, 10, 8, 10, 15),
86
                end_datetime=datetime(2020, 10, 8, 12, 20))
87
        patient_b.set_state(status_clos, self.creator, date_selected=datetime(2020, 10, 9))
88

    
89
        automated_validation(datetime(2020, 10, 5), service_camsp, self.creator)
90
        automated_validation(datetime(2020, 10, 6), service_camsp, self.creator)
91
        automated_validation(datetime(2020, 10, 7), service_camsp, self.creator)
92
        automated_validation(datetime(2020, 10, 8), service_camsp, self.creator)
93

    
94
        not_locked, days_not_locked, not_valide, not_billable, acts_pause, rejected, selected = \
95
            list_acts_for_billing_CAMSP(datetime(2020, 10, 4), datetime(2020, 10, 8), service_camsp)
96

    
97
        self.assertEqual(len(days_not_locked), 1)
98

    
99
        self.assertTrue(act1 in selected[patient_a])
100
        self.assertTrue(act2 in selected[patient_a])
101
        self.assertTrue(act3 in selected[patient_a])
102
        acts_rejected = [x[0] for x in rejected[patient_a]]
103
        self.assertTrue(act0 in acts_rejected)
104
        self.assertTrue(act4 in acts_rejected)
105

    
106
        acts_not_locked = [x[0] for x in not_locked[patient_b]]
107
        self.assertTrue(act5 in acts_not_locked)
108
        acts_not_valide = [x[0] for x in not_valide[patient_b]]
109
        self.assertTrue(act6 in acts_not_valide)
110
        self.assertTrue(act7 in not_billable[patient_b])
111
        self.assertTrue(act8 in selected[patient_b])
112
        self.assertTrue(act9 in selected[patient_b])
113
        self.assertTrue(act10 in selected[patient_b])
114
        self.assertTrue(act11 in selected[patient_b])
115

    
116
        states = patient_b.get_states_history()
117
        patient_b.change_day_selected_of_state(states[2], datetime(2020, 10, 7))
118
        not_locked, days_not_locked, not_valide, not_billable, acts_pause, rejected, selected = \
119
            list_acts_for_billing_CAMSP(datetime(2020, 10, 4), datetime(2020, 10, 8), service_camsp)
120
        acts_not_locked = [x[0] for x in not_locked[patient_b]]
121
        self.assertTrue(act5 in acts_not_locked)
122
        acts_not_valide = [x[0] for x in not_valide[patient_b]]
123
        self.assertTrue(act6 in acts_not_valide)
124
        self.assertTrue(act7 in not_billable[patient_b])
125
        acts_rejected = [x[0] for x in rejected[patient_b]]
126
        self.assertTrue(act8 in acts_rejected)
127
        self.assertTrue(act9 in acts_rejected)
128
        self.assertTrue(act10 in acts_rejected)
129
        self.assertTrue(act11 in acts_rejected)
130

    
131
        states = patient_b.get_states_history()
132
        patient_b.change_day_selected_of_state(states[2], datetime(2020, 10, 9))
133
        patient_b.change_day_selected_of_state(states[1], datetime(2020, 10, 8))
134
        not_locked, days_not_locked, not_valide, not_billable, acts_pause, rejected, selected = \
135
            list_acts_for_billing_CAMSP(datetime(2020, 10, 4), datetime(2020, 10, 8), service_camsp)
136
        acts_not_locked = [x[0] for x in not_locked[patient_b]]
137
        self.assertTrue(act5 in acts_not_locked)
138
        acts_not_valide = [x[0] for x in not_valide[patient_b]]
139
        self.assertTrue(act6 in acts_not_valide)
140
        self.assertTrue(act7 in not_billable[patient_b])
141
        acts_rejected = [x[0] for x in rejected[patient_b]]
142
        self.assertTrue(act8 in acts_rejected)
143
        self.assertTrue(act9 in acts_rejected)
144
        self.assertTrue(act10 in acts_rejected)
145
        self.assertTrue(act11 in selected[patient_b])
146

    
147
    def test_facturation_sessad(self):
148
        service_sessad = Service.objects.get(name='SESSAD DYS')
149

    
150
        patient_a = create_patient('a', 'A', service_sessad, self.creator, date_selected=datetime(2020, 10, 5))
151
        act0 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
152
                self.act_type, service_sessad, start_datetime=datetime(2020, 10, 6, 10, 15),
153
                end_datetime=datetime(2020, 10, 6, 12, 20))
154
        status_traitement = Status.objects.filter(services__name='SESSAD DYS').filter(type='TRAITEMENT')[0]
155
        patient_a.set_state(status_traitement, self.creator, date_selected=datetime(2020, 10, 7))
156
        act1 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
157
                self.act_type, service_sessad, start_datetime=datetime(2020, 10, 7, 10, 15),
158
                end_datetime=datetime(2020, 10, 7, 12, 20))
159
        act2 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
160
                self.act_type, service_sessad, start_datetime=datetime(2020, 10, 7, 14, 15),
161
                end_datetime=datetime(2020, 10, 7, 16, 20))
162
        act3 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
163
                self.act_type, service_sessad, start_datetime=datetime(2020, 10, 7, 16, 20),
164
                end_datetime=datetime(2020, 10, 7, 17, 20))
165
        status_clos = Status.objects.filter(services__name='SESSAD DYS').filter(type='CLOS')[0]
166
        patient_a.set_state(status_clos, self.creator, date_selected=datetime(2020, 10, 8))
167
        act4 = EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
168
                self.act_type, service_sessad, start_datetime=datetime(2020, 10, 8, 10, 15),
169
                end_datetime=datetime(2020, 10, 8, 12, 20))
170

    
171
        automated_validation(datetime(2020, 10, 6), service_sessad, self.creator)
172
        automated_validation(datetime(2020, 10, 7), service_sessad, self.creator)
173
        automated_validation(datetime(2020, 10, 8), service_sessad, self.creator)
174

    
175
        not_locked, days_not_locked, not_valide, not_billable, acts_pause, 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(len(missing_valid_notification[patient_a]), 3)
182
        self.assertEqual(selected, {})
183

    
184
        SessadHealthCareNotification(patient=patient_a, author=self.creator, start_date=datetime(2020,10,7), end_date=datetime(2021,10,6)).save()
185
        not_locked, days_not_locked, not_valide, not_billable, acts_pause, rejected, missing_valid_notification, selected = \
186
            list_acts_for_billing_SESSAD(datetime(2020, 10, 4), datetime(2020, 10, 8), service_sessad)
187
        self.assertEqual(not_locked, {})
188
        self.assertEqual(not_valide, {})
189
        self.assertEqual(not_billable, {})
190
        self.assertEqual(len(rejected[patient_a]), 2)
191
        self.assertEqual(missing_valid_notification, {})
192
        self.assertEqual(len(selected[patient_a]), 3)
193

    
194
    def test_facturation_cmpp(self):
195
        service_cmpp = Service.objects.get(name='CMPP')
196

    
197
        patient_a = create_patient('a', 'A', service_cmpp, self.creator, date_selected=datetime(2020, 10, 1))
198
        acts = [ EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
199
                self.act_type, service_cmpp, start_datetime=datetime(2020, 10, i, 10, 15),
200
                end_datetime=datetime(2020, 10, i, 12, 20)) for i in range (1, 32)]
201
        status_accueil = Status.objects.filter(services__name='CMPP').filter(type='ACCUEIL')[0]
202
        status_diagnostic = Status.objects.filter(services__name='CMPP').filter(type='DIAGNOSTIC')[0]
203
        status_traitement = Status.objects.filter(services__name='CMPP').filter(type='TRAITEMENT')[0]
204

    
205
        self.assertEqual(patient_a.get_state().status, status_accueil)
206
        automated_validation(datetime(2020, 10, 1), service_cmpp, self.creator)
207
        patient_a = PatientRecord.objects.get(id=patient_a.id)
208
        self.assertEqual(patient_a.get_state().status, status_diagnostic)
209
        automated_validation(datetime(2020, 10, 2), service_cmpp, self.creator)
210
        patient_a = PatientRecord.objects.get(id=patient_a.id)
211
        self.assertEqual(patient_a.get_state().status, status_diagnostic)
212
        automated_validation(datetime(2020, 10, 3), service_cmpp, self.creator)
213
        patient_a = PatientRecord.objects.get(id=patient_a.id)
214
        self.assertEqual(patient_a.get_state().status, status_diagnostic)
215
        automated_validation(datetime(2020, 10, 4), service_cmpp, self.creator)
216
        patient_a = PatientRecord.objects.get(id=patient_a.id)
217
        self.assertEqual(patient_a.get_state().status, status_diagnostic)
218
        automated_validation(datetime(2020, 10, 5), service_cmpp, self.creator)
219
        patient_a = PatientRecord.objects.get(id=patient_a.id)
220
        self.assertEqual(patient_a.get_state().status, status_diagnostic)
221
        automated_validation(datetime(2020, 10, 6), service_cmpp, self.creator)
222
        patient_a = PatientRecord.objects.get(id=patient_a.id)
223
        self.assertEqual(patient_a.get_state().status, status_diagnostic)
224
        automated_validation(datetime(2020, 10, 7), service_cmpp, self.creator)
225
        patient_a = PatientRecord.objects.get(id=patient_a.id)
226
        self.assertEqual(patient_a.get_state().status, status_traitement)
227
        automated_validation(datetime(2020, 10, 8), service_cmpp, self.creator)
228
        patient_a = PatientRecord.objects.get(id=patient_a.id)
229
        self.assertEqual(patient_a.get_state().status, status_traitement)
230
        automated_validation(datetime(2020, 10, 9), service_cmpp, self.creator)
231
        patient_a = PatientRecord.objects.get(id=patient_a.id)
232
        self.assertEqual(patient_a.get_state().status, status_traitement)
233
        for i in range(10, 32):
234
            automated_validation(datetime(2020, 10, i), service_cmpp, self.creator)
235
            patient_a = PatientRecord.objects.get(id=patient_a.id)
236
            self.assertEqual(patient_a.get_state().status, status_traitement)
237

    
238
        acts_2 = [ EventAct.objects.create_patient_appointment(self.creator, 'RDV', patient_a, [self.therapist3],
239
                self.act_type, service_cmpp, start_datetime=datetime(2020, 11, i, 10, 15),
240
                end_datetime=datetime(2020, 11, i, 12, 20)) for i in range (1, 31)]
241
        for i in range(1, 31):
242
            automated_validation(datetime(2020, 11, i), service_cmpp, self.creator)
243
            patient_a = PatientRecord.objects.get(id=patient_a.id)
244
            self.assertEqual(patient_a.get_state().status, status_traitement)
245

    
246
        self.assertEqual(get_days_with_acts_not_locked(datetime(2020, 10, 1), datetime(2020, 11, 30)), [])
247

    
248
        acts = acts + acts_2
249

    
250
        hct = CmppHealthCareTreatment(patient=patient_a, start_date=datetime(2020, 10, 7), author=self.creator)
251
        hct.save()
252
        hct.add_prolongation()
253

    
254
        billing_cmpp = list_acts_for_billing_CMPP_2(datetime(2020, 11, 30), service_cmpp)
255

    
256
        self.assertEqual(len(billing_cmpp[5][patient_a]), 6)
257
        self.assertEqual(len(billing_cmpp[6][patient_a]), 40)
258
        self.assertEqual(len(billing_cmpp[7][patient_a]), 15)
259

    
260

    
261
    def test_prices(self):
262
        price_o = add_price(120, date(2012, 10, 1))
263
        self.assertEqual(PricePerAct.get_price(), 120)
264
        price_o = add_price(130, date.today())
265
        self.assertEqual(PricePerAct.get_price(date.today() + relativedelta(days=-1)), 120)
266
        self.assertEqual(PricePerAct.get_price(date.today()), 130)
267
        self.assertEqual(PricePerAct.get_price(date.today() + relativedelta(days=1)), 130)
268
#        price_o = add_price(140, date(day=27, month=11, year=2012))
269
        price_o = add_price(140, date.today() + relativedelta(days=1))
270
        self.assertEqual(PricePerAct.get_price(date.today() + relativedelta(days=-1)), 120)
271
        self.assertEqual(PricePerAct.get_price(date.today()), 130)
272
        self.assertEqual(PricePerAct.get_price(date.today() + relativedelta(days=1)), 140)
273
        self.assertEqual(PricePerAct.get_price(date.today() + relativedelta(days=2)), 140)
274

    
275
    def test_invoicing(self):
276
        service_cmpp = Service.objects.get(name='CMPP')
277
        price_o = add_price(120, date(2012, 10, 1))
278

    
279

    
280
        patients = []
281
        for j in range(2):
282
            patients.append(create_patient(str(j), str(j), service_cmpp, self.creator, date_selected=datetime(2012, 10, 1)))
283
            acts = [ EventAct.objects.create_patient_appointment(self.creator, 'RDV', patients[j], [self.therapist3],
284
                    self.act_type, service_cmpp, start_datetime=datetime(2012, 10, i, 10, 15),
285
                    end_datetime=datetime(2012, 10, i, 12, 20)) for i in range (1, 32)]
286
            acts_2 = [ EventAct.objects.create_patient_appointment(self.creator, 'RDV', patients[j], [self.therapist3],
287
                    self.act_type, service_cmpp, start_datetime=datetime(2012, 11, i, 10, 15),
288
                    end_datetime=datetime(2012, 11, i, 12, 20)) for i in range (1, 31)]
289
            hct = CmppHealthCareTreatment(patient=patients[j], start_date=datetime(2012, 10, 7), author=self.creator)
290
            hct.save()
291
            hct.add_prolongation()
292

    
293
        for i in range(1, 32):
294
            automated_validation(datetime(2012, 10, i), service_cmpp, self.creator)
295
        for i in range(1, 31):
296
            automated_validation(datetime(2012, 11, i), service_cmpp, self.creator)
297

    
298
        self.assertEqual(get_days_with_acts_not_locked(datetime(2012, 10, 1), datetime(2012, 11, 30)), [])
299
        invoicing = Invoicing.objects.create(service=service_cmpp, seq_id=666, start_date=date.today())
300
        (len_patients, len_invoices, len_invoices_hors_pause,
301
                len_acts_invoiced, len_acts_invoiced_hors_pause,
302
                len_patient_invoiced, len_patient_invoiced_hors_pause,
303
                len_acts_lost, len_patient_with_lost_acts, patients_stats,
304
                days_not_locked, len_patient_acts_paused,
305
                len_acts_paused) = invoicing.get_stats_or_validate()
306

    
307
        self.assertEqual(len_patients, 2)
308
        self.assertEqual(len_invoices, 4)
309
        self.assertEqual(len_invoices_hors_pause, 4)
310
        self.assertEqual(len_acts_invoiced, 92) # tous les actes billed
311
        self.assertEqual(len_acts_invoiced_hors_pause, 92) # tous les actes billed - les acts qui ne seront pas billed à cause de la pause facturation
312
        self.assertEqual(len_patient_invoiced, 2)
313
        self.assertEqual(len_patient_invoiced_hors_pause, 2)
314
        self.assertEqual(len_acts_lost, 30)
315
        self.assertEqual(len_patient_with_lost_acts, 2)
316

    
317
        patients[1].pause = True
318
        patients[1].save()
319

    
320
        (len_patients, len_invoices, len_invoices_hors_pause,
321
                len_acts_invoiced, len_acts_invoiced_hors_pause,
322
                len_patient_invoiced, len_patient_invoiced_hors_pause,
323
                len_acts_lost, len_patient_with_lost_acts, patients_stats,
324
                days_not_locked, len_patient_acts_paused,
325
                len_acts_paused) = invoicing.get_stats_or_validate()
326

    
327
        self.assertEqual(len_patients, 2)
328
        self.assertEqual(len_invoices, 4)
329
        self.assertEqual(len_invoices_hors_pause, 2)
330
        self.assertEqual(len_acts_invoiced, 92) # tous les actes billed
331
        self.assertEqual(len_acts_invoiced_hors_pause, 46) # tous les actes billed - les acts qui ne seront pas billed à cause de la pause facturation
332
        self.assertEqual(len_patient_invoiced, 2)
333
        self.assertEqual(len_patient_invoiced_hors_pause, 1)
334
        self.assertEqual(len_acts_lost, 30)
335
        self.assertEqual(len_patient_with_lost_acts, 2)
336

    
337
        invoicing_next = invoicing.close(date(day=30, month=11, year=2012))
338

    
339
        (len_patients, len_invoices, len_invoices_hors_pause,
340
                len_acts_invoiced, len_acts_invoiced_hors_pause,
341
                len_patient_invoiced, len_patient_invoiced_hors_pause,
342
                len_acts_lost, len_patient_with_lost_acts, patients_stats,
343
                days_not_locked, len_patient_acts_paused,
344
                len_acts_paused) = invoicing.get_stats_or_validate(commit=True)
345

    
346
        (len_patients, len_invoices, len_invoices_hors_pause,
347
                len_acts_invoiced, len_acts_invoiced_hors_pause,
348
                len_patient_invoiced, len_patient_invoiced_hors_pause,
349
                len_acts_lost, len_patient_with_lost_acts, patients_stats,
350
                days_not_locked, len_patient_acts_paused,
351
                len_acts_paused) = invoicing.get_stats_or_validate()
352

    
353
        self.assertEqual(len_patients, 1)
354
        self.assertEqual(len_invoices, 2)
355
        self.assertEqual(len_acts_invoiced, 46)
356

    
357
        patients[1].pause = False
358
        patients[1].save()
359
        invoicing_next.close(date(day=2, month=12, year=2012))
360

    
361
        (len_patients, len_invoices, len_invoices_hors_pause,
362
                len_acts_invoiced, len_acts_invoiced_hors_pause,
363
                len_patient_invoiced, len_patient_invoiced_hors_pause,
364
                len_acts_lost, len_patient_with_lost_acts, patients_stats,
365
                days_not_locked, len_patient_acts_paused,
366
                len_acts_paused) = invoicing_next.get_stats_or_validate()
367

    
368
        self.assertEqual(len_patients, 2)
369
        self.assertEqual(len_invoices, 2)
370
        self.assertEqual(len_acts_invoiced, 46)
(6-6/8)