@@ -1158,29 +1158,22 @@ def test_fetch_notification_status_for_service_for_today_handles_midnight_utc(
1158
1158
email_template = create_template (service = service_1 , template_type = EMAIL_TYPE )
1159
1159
1160
1160
# create notifications that should not be included in today's count
1161
- create_ft_notification_status (date (2018 , 10 , 29 ), "email" , service_1 , count = 30 )
1161
+ create_ft_notification_status (date (2018 , 10 , 24 ), "email" , service_1 , count = 30 )
1162
+ create_ft_notification_status (date (2018 , 10 , 31 ), "email" , service_1 , count = 20 )
1163
+
1162
1164
save_notification (create_notification (email_template , created_at = datetime (2018 , 10 , 31 , 0 , 0 , 0 ), status = "delivered" ))
1163
1165
save_notification (create_notification (email_template , created_at = datetime (2018 , 10 , 31 , 11 , 59 , 59 ), status = "delivered" ))
1164
1166
save_notification (create_notification (email_template , created_at = datetime (2018 , 10 , 31 , 11 , 59 , 59 ), status = "delivered" ))
1165
1167
save_notification (create_notification (email_template , created_at = datetime (2018 , 10 , 31 , 23 , 59 , 59 ), status = "delivered" ))
1166
1168
1167
1169
# create notifications that should be included in count
1168
- create_ft_notification_status (date (2018 , 10 , 31 ), "email" , service_1 , count = 5 )
1169
- create_ft_notification_status (date (2018 , 10 , 30 ), "email" , service_1 , count = 5 )
1170
- save_notification (create_notification (email_template , created_at = datetime (2018 , 10 , 31 , 13 , 0 , 0 ), status = "delivered" ))
1171
- save_notification (create_notification (email_template , created_at = datetime (2018 , 10 , 31 , 6 , 0 , 0 ), status = "delivered" ))
1172
- save_notification (create_notification (email_template , created_at = datetime (2018 , 11 , 1 , 22 , 59 , 59 ), status = "delivered" ))
1170
+ save_notification (create_notification (email_template , created_at = datetime (2018 , 11 , 1 , 13 , 0 , 0 ), status = "delivered" ))
1171
+ save_notification (create_notification (email_template , created_at = datetime (2018 , 11 , 1 , 6 , 0 , 0 ), status = "delivered" ))
1172
+ save_notification (create_notification (email_template , created_at = datetime (2018 , 11 , 1 , 17 , 59 , 59 ), status = "delivered" ))
1173
1173
1174
- # checking the daily stats for this day should give us the 2 created after 12am UTC
1174
+ # checking the daily stats for this day should give us the 3 created after 12am UTC
1175
1175
results = sorted (
1176
1176
fetch_notification_status_for_service_for_today_and_7_previous_days (service_1 .id , limit_days = 1 ),
1177
1177
key = lambda x : (x .notification_type , x .status ),
1178
1178
)
1179
- assert results [0 ][2 ] == 6
1180
-
1181
- # checking the daily stats for the last 2 days should give us the 2 created after 12am UTC and the 1 from the day before
1182
- results = sorted (
1183
- fetch_notification_status_for_service_for_today_and_7_previous_days (service_1 .id , limit_days = 2 ),
1184
- key = lambda x : (x .notification_type , x .status ),
1185
- )
1186
- assert results [0 ][2 ] == 11
1179
+ assert results [0 ][2 ] == 3
0 commit comments