def get_test_doclist(doctype, name=None):
 import os, frappe
 from frappe import conf
 from frappe.modules.utils import peval_doclist
 from frappe.modules import scrub
 doctype = scrub(doctype)
 doctype_path = os.path.join(os.path.dirname(os.path.abspath(conf.__file__)), conf.test_data_path, doctype)
 if name:
  with open(os.path.join(doctype_path, (scrub(name) + u'.json')), u'r') as txtfile:
   doclist = peval_doclist(txtfile.read())
  return doclist
 else:
  all_doclists = []
  for fname in filter((lambda n: n.endswith(u'.json')), os.listdir(doctype_path)):
   with open(os.path.join(doctype_path, scrub(fname)), u'r') as txtfile:
    all_doclists.append(peval_doclist(txtfile.read()))
  return all_doclists

def get_test_doclist ( doctype , name = None ) : import os , frappe from frappe import conf from frappe . modules . utils import peval_doclist from frappe . modules import scrub doctype = scrub ( doctype ) doctype_path = os . path . join ( os . path . dirname ( os . path . abspath ( conf . __file__ ) ) , conf . test_data_path , doctype ) if name : with open ( os . path . join ( doctype_path , ( scrub ( name ) + u'.json' ) ) , u'r' ) as txtfile : doclist = peval_doclist ( txtfile . read ( ) ) return doclist else : all_doclists = [ ] for fname in filter ( ( lambda n : n . endswith ( u'.json' ) ) , os . listdir ( doctype_path ) ) : with open ( os . path . join ( doctype_path , scrub ( fname ) ) , u'r' ) as txtfile : all_doclists . append ( peval_doclist ( txtfile . read ( ) ) ) return all_doclists
get test doclist .