diff --git a/blitz_api/models.py b/blitz_api/models.py index 168c0ed0..1082f3fe 100644 --- a/blitz_api/models.py +++ b/blitz_api/models.py @@ -411,11 +411,11 @@ def tomato_field_matrix(self): def current_month_tomatoes(self): today = timezone.now() first_day = today.replace( - day=1, hour=0, minute=0, microsecond=0 + day=1, hour=0, minute=0, second=0, microsecond=0 ) day = calendar.monthrange(today.year, today.month)[1] last_day = today.replace( - day=day, hour=23, minute=59, microsecond=999999 + day=day, hour=23, minute=59, second=59, microsecond=999999 ) nb_tomatoes = Tomato.objects.filter( user=self, diff --git a/tomato/tests/tests_viewset_Tomato.py b/tomato/tests/tests_viewset_Tomato.py index 3cd6881f..0572e634 100644 --- a/tomato/tests/tests_viewset_Tomato.py +++ b/tomato/tests/tests_viewset_Tomato.py @@ -383,11 +383,11 @@ def test_filter_acquisition_date_as_user(self): """ today = timezone.now() first_day = today.replace( - day=1, hour=0, minute=0, microsecond=0 + day=1, hour=0, minute=0, second=0, microsecond=0 ) day = calendar.monthrange(today.year, today.month)[1] last_day = today.replace( - day=day, hour=23, minute=59, microsecond=999999 + day=day, hour=23, minute=59, second=59, microsecond=999999 ) next_month = today + timedelta(days=31) last_month = today - timedelta(days=31)