[fix] test_form

This commit is contained in:
Anand Doshi 2015-10-15 14:08:29 +05:30
parent 999cea874c
commit f178ef0911
2 changed files with 5 additions and 5 deletions

View file

@ -9,7 +9,7 @@ import frappe.desk.form.meta
import frappe.desk.form.load
@frappe.whitelist()
def get_linked_docs(doctype, name, linkinfo):
def get_linked_docs(doctype, name, linkinfo=None):
results = frappe.cache().get_value("linked_with:{doctype}:{name}".format(doctype=doctype, name=name))
if results:
return results

View file

@ -1,17 +1,17 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, unittest
from frappe.desk.form.utils import get_linked_docs
from frappe.desk.form.linked_with import get_linked_docs, get_linked_doctypes
class TestForm(unittest.TestCase):
def test_linked_with(self):
results = get_linked_docs("Role", "System Manager")
results = get_linked_docs("Role", "System Manager", linkinfo=get_linked_doctypes("Role"))
self.assertTrue("User" in results)
self.assertTrue("DocType" in results)
if __name__=="__main__":
frappe.connect()
unittest.main()