integrations/stripe: Use global time.

This commit is contained in:
Niloth P 2025-10-13 07:57:19 +05:30 committed by Tim Abbott
parent a25445bf27
commit 5c8d9edaae
2 changed files with 8 additions and 7 deletions

View File

@ -141,13 +141,13 @@ Billing method: send invoice"""
expected_topic_name = "cus_00000000000000"
expected_message = """\
[Subscription](https://dashboard.stripe.com/subscriptions/sub_E6STM5w5EX3K28) updated
* Billing cycle anchor is now Nov 01, 2019, 12:00:00 UTC
* Current period end is now Nov 01, 2019, 12:00:00 UTC
* Current period start is now Dec 06, 2018, 05:53:55 UTC
* Start is now Dec 06, 2018, 05:53:55 UTC
* Billing cycle anchor is now <time:Nov 01, 2019, 12:00:00 UTC>
* Current period end is now <time:Nov 01, 2019, 12:00:00 UTC>
* Current period start is now <time:Dec 06, 2018, 05:53:55 UTC>
* Start is now <time:Dec 06, 2018, 05:53:55 UTC>
* Status is now trialing
* Trial end is now Nov 01, 2019, 12:00:00 UTC
* Trial start is now Dec 06, 2018, 05:53:55 UTC"""
* Trial end is now <time:Nov 01, 2019, 12:00:00 UTC>
* Trial start is now <time:Dec 06, 2018, 05:53:55 UTC>"""
self.check_webhook(
"customer_subscription_updated",
expected_topic_name,

View File

@ -363,5 +363,6 @@ def linkified_id(object_id: str, lower: bool = False) -> str:
def stringify(value: object) -> str:
if isinstance(value, int) and value > 1500000000 and value < 2000000000:
return timestamp_to_datetime(value).strftime("%b %d, %Y, %H:%M:%S %Z")
datetime_value = timestamp_to_datetime(value).strftime("%b %d, %Y, %H:%M:%S %Z")
return f"<time:{datetime_value}>"
return str(value)