Fix performance of check-in list API list

This commit is contained in:
Raphael Michel
2019-09-26 15:18:53 +02:00
parent f296f262e6
commit ce6e46dfd2
5 changed files with 50 additions and 144 deletions

View File

@@ -1972,8 +1972,8 @@ class CheckinListTestCase(TestCase):
op4.checkins.create(list=cls.cl_all_pending)
@classscope(attr='organizer')
def test_annotated(self):
lists = list(CheckinList.annotate_with_numbers(self.event.checkin_lists.order_by('name'), self.event))
def test_attributes(self):
lists = list(self.event.checkin_lists.order_by('name'))
assert lists == [self.cl_all, self.cl_both, self.cl_tickets, self.cl_all_pending]
assert lists[0].checkin_count == 0
assert lists[0].position_count == 3