@@ -45,6 +45,7 @@ def cache(organisation: Organisation) -> OrganisationSubscriptionInformationCach
4545
4646
4747@pytest .mark .use_analytics_db
48+ @pytest .mark .freeze_time ("2023-01-19T09:09:47.325132+00:00" )
4849def test_get_usage_data_from_local_db__multiple_buckets__returns_aggregated_daily_data ( # type: ignore[no-untyped-def]
4950 organisation , environment , settings
5051):
@@ -197,6 +198,7 @@ def test_get_usage_data_from_local_db__environment_filter__returns_expected(
197198
198199
199200@pytest .mark .use_analytics_db
201+ @pytest .mark .freeze_time ("2023-01-19T09:09:47.325132+00:00" )
200202def test_get_usage_data_from_local_db__labels_filter__returns_expected (
201203 organisation : Organisation ,
202204 environment : Environment ,
@@ -269,6 +271,7 @@ def test_get_usage_data_from_local_db__labels_filter__returns_expected(
269271
270272
271273@pytest .mark .use_analytics_db
274+ @pytest .mark .freeze_time ("2023-01-19T09:09:47.325132+00:00" )
272275def test_get_total_events_count__multiple_buckets__returns_correct_total ( # type: ignore[no-untyped-def]
273276 organisation , environment , settings
274277):
@@ -322,6 +325,7 @@ def test_get_total_events_count__multiple_buckets__returns_correct_total( # typ
322325
323326
324327@pytest .mark .use_analytics_db
328+ @pytest .mark .freeze_time ("2023-01-19T09:09:47.325132+00:00" )
325329def test_get_feature_evaluation_data_from_local_db__multiple_buckets__returns_aggregated_daily_data (
326330 feature : Feature ,
327331 environment : Environment ,
@@ -538,6 +542,7 @@ def test_get_usage_data__no_analytics_configured__no_calls_expected(
538542 mocked_get_usage_data_from_local_db .assert_not_called ()
539543
540544
545+ @pytest .mark .freeze_time ("2023-01-19T09:09:47.325132+00:00" )
541546def test_get_total_events_count__postgres_not_configured__calls_influx ( # type: ignore[no-untyped-def]
542547 mocker , settings , organisation
543548):
@@ -553,7 +558,9 @@ def test_get_total_events_count__postgres_not_configured__calls_influx( # type:
553558 # Then
554559 assert total_events_count == mocked_get_events_for_organisation .return_value
555560 mocked_get_events_for_organisation .assert_called_once_with (
556- organisation_id = organisation .id
561+ organisation .id ,
562+ date_start = datetime (2022 , 12 , 20 , 0 , 0 , tzinfo = UTC ),
563+ date_stop = datetime (2023 , 1 , 19 , 0 , 0 , tzinfo = UTC ),
557564 )
558565
559566
0 commit comments