Project

General

Profile

« Previous | Next » 

Revision 6cbd00a4

Added by Benjamin Dauvergne about 11 years ago

agenda: adapt tests to new Event/Act interactions

View differences:

calebasse/agenda/tests.py
120 120
        occurences = list(appointment2.all_occurences())
121 121
        self.assertEqual(len(occurences), 2)
122 122
        self.assertEqual(Act.objects.filter(parent_event=appointment2).count(), 0)
123
        [o.act for o in occurences]
124
        self.assertEqual(Act.objects.filter(parent_event=appointment2).count(), 2)
125 123
        self.assertEqual(occurences[0].act.date, occurences[0].start_datetime.date())
126 124
        self.assertEqual(occurences[1].act.date, occurences[1].start_datetime.date())
127 125
        appointment2.recurrence_periodicity = None
128 126
        appointment2.save()
129
        self.assertEqual(Act.objects.filter(parent_event=appointment2).count(),
130
                1)
127
        self.assertEqual(Act.objects.filter(parent_event=appointment2).count(), 0)
131 128
        appointment2.recurrence_periodicity = 2
132 129
        appointment2.recurrence_end_date = date(2020, 10, 16)
133 130
        appointment2.save()
134 131
        occurences = list(appointment2.all_occurences())
135 132
        self.assertEqual(len(occurences), 2)
136
        self.assertEqual(Act.objects.filter(parent_event=appointment2).count(), 1)
137 133
        [o.act for o in occurences]
138
        self.assertEqual(Act.objects.filter(parent_event=appointment2).count(), 2)
139 134
        occurences[1].act.set_state('ANNUL_NOUS', self.creator)
140 135
        occurences[0].delete()
141 136
        occurences = list(appointment2.all_occurences())

Also available in: Unified diff