瀏覽代碼

test: Added test to check change in property value after alert

version-14
Shariq Ansari 3 年之前
父節點
當前提交
0fc092a98e
共有 1 個檔案被更改,包括 17 行新增0 行删除
  1. +17
    -0
      frappe/email/doctype/notification/test_notification.py

+ 17
- 0
frappe/email/doctype/notification/test_notification.py 查看文件

@@ -20,6 +20,8 @@ class TestNotification(unittest.TestCase):
notification.event = 'Value Change'
notification.value_changed = 'status'
notification.send_to_all_assignees = 1
notification.set_property_after_alert = 'description'
notification.property_value = 'Changed by Notification'
notification.save()

if not frappe.db.exists('Notification', {'name': 'Contact Status Update'}, 'name'):
@@ -269,4 +271,19 @@ class TestNotification(unittest.TestCase):
self.assertTrue('test2@example.com' in recipients)
self.assertTrue('test1@example.com' in recipients)

def test_change_property_value_after_alert(self):
todo = frappe.new_doc('ToDo')
todo.description = 'Test Property Change after Alert'
todo.save()

#change status of todo
todo.status = 'Closed'
todo.save()

email_queue = frappe.get_doc('Email Queue', {'reference_doctype': 'ToDo',
'reference_name': todo.name})

self.assertTrue(email_queue)
self.assertEquals(todo.description, 'Changed by Notification')



Loading…
取消
儲存