Backend and frontend testing stacks (pytest + vitest) and a few initial tests.

This commit is contained in:
2026-02-27 16:03:06 +03:00
parent 46af911a06
commit be2590d7f7
10 changed files with 104 additions and 2 deletions
@@ -0,0 +1,13 @@
import pytest
from django.test import override_settings
from apps.accounts.models import OtpChannel
from apps.accounts.services.otp import OtpRateLimitError, create_and_send_otp
@pytest.mark.django_db
@override_settings(OTP_MAX_PER_WINDOW=1, OTP_WINDOW_MINUTES=15, OTP_RESEND_COOLDOWN_SECONDS=0)
def test_otp_rate_limit():
create_and_send_otp("+966512345678", OtpChannel.SMS)
with pytest.raises(OtpRateLimitError):
create_and_send_otp("+966512345678", OtpChannel.SMS)