seitime-frappe/frappe/tests/test_assign.py
Anand Doshi f6cdd4a655 Merge remote-tracking branch 'frappe/develop' into v5.0
Conflicts:
	frappe/__version__.py
	frappe/core/doctype/communication/communication.py
	frappe/core/page/desktop/desktop.js
	frappe/hooks.py
	frappe/translations/ar.csv
	frappe/translations/es.csv
	frappe/translations/fr.csv
	frappe/translations/hr.csv
	frappe/translations/id.csv
	frappe/translations/ja.csv
	frappe/translations/nl.csv
	frappe/translations/pl.csv
	frappe/translations/pt-BR.csv
	frappe/translations/ru.csv
	frappe/translations/tr.csv
	frappe/translations/zh-cn.csv
	frappe/translations/zh-tw.csv
	frappe/utils/email_lib/html2text.py
	setup.py
2015-02-24 18:06:16 +05:30

24 lines
884 B
Python

# Copyright (c) 2014, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, unittest
import frappe.desk.form.assign_to
class TestAssign(unittest.TestCase):
def test_assign(self):
todo = frappe.get_doc({"doctype":"ToDo", "description": "test"}).insert()
if not frappe.db.exists("User", "test@example.com"):
frappe.get_doc({"doctype":"User", "email":"test@example.com", "first_name":"Test"})
added = frappe.desk.form.assign_to.add({
"assign_to": "test@example.com",
"doctype": todo.doctype,
"name": todo.name,
"description": todo.description,
})
self.assertTrue("test@example.com" in [d.owner for d in added])
removed = frappe.desk.form.assign_to.remove(todo.doctype, todo.name, "test@example.com")
self.assertTrue("test@example.com" not in [d.owner for d in removed])