Skip to content

Commit

Permalink
fix MOCK_DATETIME
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Soldatenko committed Feb 24, 2023
1 parent 74876cf commit 86e8bbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions tests/sentry/dynamic_sampling/test_prioritise_projects.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from datetime import datetime, timezone
from datetime import timedelta

from django.utils import timezone
from freezegun import freeze_time

from sentry.dynamic_sampling.prioritise_projects import fetch_projects_with_total_volumes
from sentry.snuba.metrics import TransactionMRI
from sentry.testutils import BaseMetricsLayerTestCase, SnubaTestCase, TestCase

MOCK_DATETIME = datetime(2023, 8, 7, 0, 0, 0, tzinfo=timezone.utc)
MOCK_DATETIME = (timezone.now() - timedelta(days=1)).replace(
hour=0, minute=0, second=0, microsecond=0
)


@freeze_time(MOCK_DATETIME)
Expand Down
6 changes: 4 additions & 2 deletions tests/sentry/dynamic_sampling/test_tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import timedelta
from unittest.mock import patch

import pytest
Expand All @@ -11,7 +11,9 @@
from sentry.testutils import BaseMetricsLayerTestCase, SnubaTestCase, TestCase
from sentry.testutils.helpers import Feature

MOCK_DATETIME = datetime(2023, 8, 7, 0, 0, 0, tzinfo=timezone.utc)
MOCK_DATETIME = (timezone.now() - timedelta(days=1)).replace(
hour=0, minute=0, second=0, microsecond=0
)


@freeze_time(MOCK_DATETIME)
Expand Down

0 comments on commit 86e8bbe

Please sign in to comment.