2020-12-13 19:18:58 +01:00
|
|
|
import arrow
|
|
|
|
|
2022-04-15 16:59:44 +02:00
|
|
|
from app.models import CoinbaseSubscription
|
2020-12-13 19:18:58 +01:00
|
|
|
from cron import notify_manual_sub_end
|
2022-04-15 16:59:44 +02:00
|
|
|
from tests.utils import create_new_user
|
2020-12-13 19:18:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_notify_manual_sub_end(flask_client):
|
2022-04-15 16:59:44 +02:00
|
|
|
user = create_new_user()
|
2020-12-13 19:18:58 +01:00
|
|
|
|
2020-12-13 19:31:16 +01:00
|
|
|
CoinbaseSubscription.create(
|
2020-12-13 19:18:58 +01:00
|
|
|
user_id=user.id, end_at=arrow.now().shift(days=13, hours=2), commit=True
|
|
|
|
)
|
|
|
|
|
|
|
|
notify_manual_sub_end()
|