0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-25 02:31:30 +01:00
posthog/ee/tasks/test/subscriptions/subscriptions_test_factory.py
Ben White 1484b846ce
feat(subscriptions): Add Slack Subscriptions (#10388)
* Added slack configuration options
* Added slack selection UI
2022-06-24 10:29:45 +02:00

20 lines
490 B
Python

from datetime import datetime
from typing import Any
import pytz
from posthog.models.subscription import Subscription
def create_subscription(**kwargs: Any) -> Subscription:
payload = dict(
target_type="email",
target_value="test1@posthog.com,test2@posthog.com",
frequency="daily",
interval=1,
start_date=datetime(2022, 1, 1, 9, 0).replace(tzinfo=pytz.UTC),
)
payload.update(kwargs)
return Subscription.objects.create(**payload)