def test_do_not_include_not_full_if_user_is_collector(self): with group_timezone_at(self.group, hour=20): self.create_user_pickup(relativedelta(minutes=50), max_collectors=2) self.create_user_pickup(relativedelta(hours=8), max_collectors=2) entries = fetch_pickup_notification_data_for_group(self.group) self.assertEqual(list(entries[0]['tonight_not_full']), []) self.assertEqual(list(entries[0]['tomorrow_not_full']), [])
def test_empty_pickups(self): with group_timezone_at(self.group, hour=20): empty_pickup_tonight = self.create_empty_pickup( relativedelta(minutes=50)) empty_pickup_tomorrow = self.create_empty_pickup( relativedelta(hours=8)) entries = fetch_pickup_notification_data_for_group(self.group) self.assertEqual(list(entries[0]['tonight_empty']), [empty_pickup_tonight]) self.assertEqual(list(entries[0]['tomorrow_empty']), [empty_pickup_tomorrow])
def test_user_pickups(self): with group_timezone_at(self.group, hour=20): user_pickup_tonight = self.create_user_pickup( relativedelta(minutes=50), max_collectors=1) user_pickup_tomorrow = self.create_user_pickup( relativedelta(hours=8), max_collectors=1) entries = fetch_pickup_notification_data_for_group(self.group) self.assertEqual(list(entries[0]['tonight_user']), [user_pickup_tonight]) self.assertEqual(list(entries[0]['tomorrow_user']), [user_pickup_tomorrow])