|
|
|
@ -2771,8 +2771,9 @@ def test_recurring_events_create_past_recurrences(freezer):
|
|
|
|
|
def test_shared_custody_agenda():
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
SharedCustodyRule.objects.create(agenda=agenda, days=list(range(7)), weeks='even', guardian=father)
|
|
|
|
@ -2829,8 +2830,9 @@ def test_shared_custody_agenda():
|
|
|
|
|
def test_shared_custody_agenda_different_periodicity():
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
SharedCustodyRule.objects.create(agenda=agenda, days=[1, 2, 3], guardian=father)
|
|
|
|
@ -2880,8 +2882,9 @@ def test_shared_custody_agenda_different_periodicity():
|
|
|
|
|
def test_shared_custody_agenda_is_complete(rules, complete):
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for i, rule in enumerate(rules):
|
|
|
|
@ -2912,8 +2915,9 @@ def test_shared_custody_agenda_is_complete(rules, complete):
|
|
|
|
|
def test_shared_custody_agenda_rule_overlaps(rules, days, weeks, overlaps):
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for i, rule in enumerate(rules):
|
|
|
|
@ -2928,8 +2932,9 @@ def test_shared_custody_agenda_holiday_rule_overlaps():
|
|
|
|
|
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
summer_holiday = TimePeriodExceptionGroup.objects.create(
|
|
|
|
@ -3000,8 +3005,9 @@ def test_shared_custody_agenda_holiday_rule_overlaps():
|
|
|
|
|
def test_shared_custody_agenda_period_overlaps(periods, date_start, date_end, overlaps):
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
for i, dates in enumerate(periods):
|
|
|
|
@ -3018,8 +3024,9 @@ def test_shared_custody_agenda_period_holiday_rule_no_overlaps():
|
|
|
|
|
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
summer_holiday = TimePeriodExceptionGroup.objects.create(
|
|
|
|
@ -3037,8 +3044,9 @@ def test_shared_custody_agenda_period_holiday_rule_no_overlaps():
|
|
|
|
|
def test_shared_custody_agenda_rule_label():
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
rule = SharedCustodyRule.objects.create(agenda=agenda, guardian=father, days=list(range(7)))
|
|
|
|
@ -3071,8 +3079,9 @@ def test_shared_custody_agenda_holiday_rule_label():
|
|
|
|
|
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
summer_holiday = TimePeriodExceptionGroup.objects.create(
|
|
|
|
@ -3111,8 +3120,9 @@ def test_shared_custody_agenda_holiday_rule_label():
|
|
|
|
|
def test_shared_custody_agenda_period_label(freezer):
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
period = SharedCustodyPeriod.objects.create(
|
|
|
|
@ -3133,8 +3143,9 @@ def test_shared_custody_agenda_holiday_rule_create_periods():
|
|
|
|
|
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
summer_holiday = TimePeriodExceptionGroup.objects.create(
|
|
|
|
@ -3238,8 +3249,9 @@ def test_shared_custody_agenda_holiday_rule_create_periods_christmas_holidays():
|
|
|
|
|
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
christmas_holiday = TimePeriodExceptionGroup.objects.create(
|
|
|
|
@ -3300,8 +3312,9 @@ def test_shared_custody_agenda_holiday_rules_application():
|
|
|
|
|
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
christmas_holiday = TimePeriodExceptionGroup.objects.create(
|
|
|
|
@ -3349,8 +3362,9 @@ def test_shared_custody_agenda_update_holiday_rules_command():
|
|
|
|
|
|
|
|
|
|
father = Person.objects.create(user_external_id='father_id', first_name='John', last_name='Doe')
|
|
|
|
|
mother = Person.objects.create(user_external_id='mother_id', first_name='Jane', last_name='Doe')
|
|
|
|
|
child = Person.objects.create(user_external_id='child_id', first_name='James', last_name='Doe')
|
|
|
|
|
agenda = SharedCustodyAgenda.objects.create(
|
|
|
|
|
first_guardian=father, second_guardian=mother, date_start=now()
|
|
|
|
|
first_guardian=father, second_guardian=mother, child=child, date_start=now()
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
christmas_holiday = TimePeriodExceptionGroup.objects.create(
|
|
|
|
|