-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(python): replace pytz.utc with ZoneInfo('UTC') (#17310)
- Loading branch information
1 parent
b2016e4
commit 215de61
Showing
29 changed files
with
184 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from datetime import datetime | ||
from typing import Any | ||
|
||
import pytz | ||
from zoneinfo import ZoneInfo | ||
|
||
from posthog.models.subscription import Subscription | ||
|
||
|
@@ -12,7 +12,7 @@ def create_subscription(**kwargs: Any) -> Subscription: | |
target_value="[email protected],[email protected]", | ||
frequency="daily", | ||
interval=1, | ||
start_date=datetime(2022, 1, 1, 9, 0).replace(tzinfo=pytz.UTC), | ||
start_date=datetime(2022, 1, 1, 9, 0).replace(tzinfo=ZoneInfo("UTC")), | ||
) | ||
|
||
payload.update(kwargs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
from unittest.mock import ANY, patch | ||
|
||
import pytest | ||
import pytz | ||
from zoneinfo import ZoneInfo | ||
from django.core import mail | ||
from django.urls.base import reverse | ||
from django.utils import timezone | ||
|
@@ -733,7 +733,7 @@ def test_api_invite_sign_up_prevalidate_expired_invite(self): | |
invite: OrganizationInvite = OrganizationInvite.objects.create( | ||
target_email="[email protected]", organization=self.organization | ||
) | ||
invite.created_at = datetime.datetime(2020, 12, 1, tzinfo=pytz.UTC) | ||
invite.created_at = datetime.datetime(2020, 12, 1, tzinfo=ZoneInfo("UTC")) | ||
invite.save() | ||
|
||
response = self.client.get(f"/api/signup/{invite.id}/") | ||
|
@@ -1132,7 +1132,7 @@ def test_cant_claim_expired_invite(self): | |
invite: OrganizationInvite = OrganizationInvite.objects.create( | ||
target_email="[email protected]", organization=self.organization | ||
) | ||
invite.created_at = datetime.datetime(2020, 3, 3, tzinfo=pytz.UTC) | ||
invite.created_at = datetime.datetime(2020, 3, 3, tzinfo=ZoneInfo("UTC")) | ||
invite.save() | ||
|
||
response = self.client.post(f"/api/signup/{invite.id}/", {"first_name": "Charlie", "password": "test_password"}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.