[fix] test_form
This commit is contained in:
parent
999cea874c
commit
f178ef0911
2 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue