fix payement link and gallery image

This commit is contained in:
javad committed 2026-10-06 11:18:31 +03:30
1 parent de3135b588
commit 1cbbbbd0dc
24 files changed
+654 -116

No files matched your search

+5 -1
View File
@@ -206,6 +206,7 @@ def test_missing_policy_stays_unapproved_until_manager_assigns(case):
def test_sms_uses_database_template_and_attempt_history(case,monkeypatch):
from apps.notifications.management.commands import process_notifications
from apps.payments.models import PaymentNotification
template=SMSTemplate.objects.get(event_type='PAYMENT_NOTICE_CREATED',unit__isnull=True)
template.body='متن سفارشی {notice_number} {payment_link}';template.save()
captured=[]
@@ -217,7 +218,10 @@ def test_sms_uses_database_template_and_attempt_history(case,monkeypatch):
process_notifications._send_sms(job)
template.body='جدید';template.save()
process_notifications._send_sms(job)
assert captured[0] == captured[1] and 'متن سفارشی' in captured[0] and '/chaharsu/' in captured[0]
notification = PaymentNotification.objects.get(job=job)
assert captured[0] == captured[1] and 'متن سفارشی' in captured[0]
assert '/p/' in notification.context['payment_link']
assert notification.context['payment_link'] in captured[0]
assert PaymentNotificationAttempt.objects.filter(success=True).count() == 2
assert job.ticket is None