added some test records

This commit is contained in:
Anand Doshi
2013-02-07 19:47:34 +05:30
parent c39d13b6a7
commit 6209046772
20 changed files with 210 additions and 68 deletions

View File

@@ -23,8 +23,6 @@ from webnotes import msgprint
sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
test_records = []
class DocType:
def __init__(self,d,dl):
self.doc, self.doclist = d,dl
@@ -208,3 +206,31 @@ def get_parent_account(doctype, txt, searchfield, start, page_len, args):
return webnotes.conn.sql("""select name from tabAccount
where group_or_ledger = 'Group' and docstatus != 2 and company = '%s'
and name like '%%%s%%'""" % (args["company"], txt))
def make_test_records(verbose):
from webnotes.test_runner import load_module_and_make_records, make_test_objects
load_module_and_make_records("Company", verbose)
accounts = [
# [account_name, parent_account, group_or_ledger]
["_Test Account Stock Expenses", "Direct Expenses - _TC", "Group"],
["_Test Account Shipping Charges", "_Test Account Stock Expenses - _TC", "Ledger"],
["_Test Account Customs Duty", "_Test Account Stock Expenses - _TC", "Ledger"],
["_Test Account Tax Assets", "Current Assets - _TC", "Group"],
["_Test Account VAT", "_Test Account Tax Assets - _TC", "Ledger"],
["_Test Account Cost for Goods Sold", "Expenses - _TC", "Ledger"],
["_Test Account Excise Duty", "_Test Account Tax Assets - _TC", "Ledger"],
["_Test Account Education Cess", "_Test Account Tax Assets - _TC", "Ledger"],
["_Test Account S&H Education Cess", "_Test Account Tax Assets - _TC", "Ledger"],
["_Test Account CST", "Direct Expenses - _TC", "Ledger"],
["_Test Account Discount", "Direct Expenses - _TC", "Ledger"]
]
return make_test_objects([[{
"doctype": "Account",
"account_name": account_name,
"parent_account": parent_account,
"company": "_Test Company",
"group_or_ledger": group_or_ledger
}] for account_name, parent_account, group_or_ledger in accounts])