All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m14s
- Implemented push subscription API with tests for subscribing and unsubscribing users. - Created web push notification tests triggered by child actions. - Added digest scheduler to send email digests to users at 9 PM local time. - Developed utility functions for creating and validating digest action tokens. - Integrated web push sender to handle sending notifications to users. - Added service worker for handling push notifications in the frontend. - Created a push opt-in component for user notification preferences. - Implemented tests for the push opt-in component to ensure correct behavior. - Updated frontend services to manage push subscriptions and permissions.
22 lines
916 B
Python
22 lines
916 B
Python
import os
|
|
os.environ['DB_ENV'] = 'test'
|
|
os.environ.setdefault('SECRET_KEY', 'test-secret-key')
|
|
os.environ.setdefault('REFRESH_TOKEN_EXPIRY_DAYS', '90')
|
|
os.environ.setdefault('DIGEST_TOKEN_SECRET', 'test-digest-secret')
|
|
os.environ.setdefault('VAPID_PUBLIC_KEY', 'test-vapid-public-key')
|
|
os.environ.setdefault('VAPID_PRIVATE_KEY', 'test-vapid-private-key')
|
|
import sys
|
|
import pytest
|
|
|
|
# Ensure backend root is in sys.path for imports like 'config.paths'
|
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
|
|
# Shared test constants — import these in test files instead of hardcoding
|
|
TEST_SECRET_KEY = 'test-secret-key'
|
|
TEST_REFRESH_TOKEN_EXPIRY_DAYS = 90
|
|
|
|
@pytest.fixture(scope="session", autouse=True)
|
|
def set_test_db_env():
|
|
os.environ['DB_ENV'] = 'test'
|
|
os.environ['SECRET_KEY'] = TEST_SECRET_KEY
|
|
os.environ['REFRESH_TOKEN_EXPIRY_DAYS'] = str(TEST_REFRESH_TOKEN_EXPIRY_DAYS) |