Fixed asset test cases due to tax rule (#11247)

* Fixed asset testcases due to tax rule

* Delete tax rule record after running test cases

* Fixed test cases

* Fixed test cases

* Fixed subscription tests due to tax rule
This commit is contained in:
Nabin Hait 2017-10-19 12:14:37 +05:30 committed by GitHub
parent 5fa2adcca9
commit bb60a59b96
5 changed files with 9 additions and 3 deletions

View File

@ -13,6 +13,7 @@ class TestAsset(unittest.TestCase):
def setUp(self): def setUp(self):
set_depreciation_settings_in_company() set_depreciation_settings_in_company()
create_asset() create_asset()
frappe.db.sql("delete from `tabTax Rule`")
def test_purchase_asset(self): def test_purchase_asset(self):
asset = frappe.get_doc("Asset", "Macbook Pro 1") asset = frappe.get_doc("Asset", "Macbook Pro 1")

View File

@ -30,7 +30,7 @@ class TestSubscription(unittest.TestCase):
new_quotation = frappe.get_doc('Quotation', new_quotation) new_quotation = frappe.get_doc('Quotation', new_quotation)
for fieldname in ['customer', 'company', 'order_type', 'total', 'grand_total']: for fieldname in ['customer', 'company', 'order_type', 'total', 'net_total']:
self.assertEquals(quotation.get(fieldname), new_quotation.get(fieldname)) self.assertEquals(quotation.get(fieldname), new_quotation.get(fieldname))
for fieldname in ['item_code', 'qty', 'rate', 'amount']: for fieldname in ['item_code', 'qty', 'rate', 'amount']:

View File

@ -11,7 +11,10 @@ test_records = frappe.get_test_records('Tax Rule')
class TestTaxRule(unittest.TestCase): class TestTaxRule(unittest.TestCase):
def setUp(self): def setUp(self):
frappe.db.sql("delete from `tabTax Rule` where use_for_shopping_cart <> 1") frappe.db.sql("delete from `tabTax Rule`")
def tearDown(self):
frappe.db.sql("delete from `tabTax Rule`")
def test_conflict(self): def test_conflict(self):
tax_rule1 = make_tax_rule(customer= "_Test Customer", tax_rule1 = make_tax_rule(customer= "_Test Customer",

View File

@ -39,3 +39,4 @@ class TestShoppingCartSettings(unittest.TestCase):
frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 1") frappe.db.sql("update `tabTax Rule` set use_for_shopping_cart = 1")
test_dependencies = ["Tax Rule"]

View File

@ -190,7 +190,8 @@ class TestItem(unittest.TestCase):
"increment": 0.5 "increment": 0.5
} }
], ],
"default_warehouse": "_Test Warehouse - _TC" "default_warehouse": "_Test Warehouse - _TC",
"has_variants": 1
}) })
variant = create_variant("_Test Numeric Template Item", variant = create_variant("_Test Numeric Template Item",