Update asset related test cases

This commit is contained in:
Shreya 2018-06-06 04:27:59 +05:30
parent 80a1e156cb
commit 9aa7d8fe5f
2 changed files with 10 additions and 1 deletions

View File

@ -5,7 +5,7 @@ from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import cstr, nowdate, getdate, flt
from frappe.utils import cstr, nowdate, getdate, flt, add_days
from erpnext.assets.doctype.asset.depreciation import post_depreciation_entries, scrap_asset, restore_asset
from erpnext.assets.doctype.asset.asset import make_sales_invoice, make_purchase_invoice
@ -326,6 +326,7 @@ def create_asset():
"gross_purchase_amount": 100000,
"expected_value_after_useful_life": 10000,
"warehouse": "_Test Warehouse - _TC",
"available_for_use_date": add_days(nowdate(),3),
"location": "Test Location",
"asset_owner": "Company"
})

View File

@ -44,6 +44,12 @@ def create_asset():
if not frappe.db.exists("Asset Category", "Equipment"):
create_asset_category()
if not frappe.db.exists("Location", "Test Location"):
frappe.get_doc({
'doctype': 'Location',
'location_name': 'Test Location'
}).insert()
if not frappe.db.exists("Item", "Photocopier"):
frappe.get_doc({
"doctype": "Item",
@ -65,6 +71,8 @@ def create_asset():
"gross_purchase_amount": 100000,
"expected_value_after_useful_life": 10000,
"warehouse": "_Test Warehouse - _TC",
"location": "Test Location",
"available_for_use_date": add_days(nowdate(),3),
"company": "_Test Company",
"purchase_date": nowdate(),
"maintenance_required": 1,