Fixes for travis (#12161)

* Fixes for travis

* Testcase fixes for get_item_details

* Testcase fixes for get_item_details

* Travis fixes

* Travis fixes
This commit is contained in:
Nabin Hait 2017-12-26 17:50:34 +05:30 committed by GitHub
parent f06c281964
commit 123759aff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -94,6 +94,7 @@ class TestPaymentEntry(unittest.TestCase):
pe.reference_no = "1"
pe.reference_date = "2016-01-01"
pe.source_exchange_rate = 1
pe.paid_to = payable
pe.insert()
pe.submit()

View File

@ -27,6 +27,7 @@ class TestPurchaseInvoice(unittest.TestCase):
unlink_payment_on_cancel_of_invoice(0)
def test_gl_entries_without_perpetual_inventory(self):
frappe.db.set_value("Company", "_Test Company", "round_off_account", "Round Off - _TC")
wrapper = frappe.copy_doc(test_records[0])
set_perpetual_inventory(0, wrapper.company)
self.assertTrue(not cint(erpnext.is_perpetual_inventory_enabled(wrapper.company)))

View File

@ -129,7 +129,6 @@ def _make_customer(source_name, target_doc=None, ignore_permissions=False):
}
}}, target_doc, set_missing_values, ignore_permissions=ignore_permissions)
print(doclist)
return doclist
@frappe.whitelist()

View File

@ -5,13 +5,14 @@ from __future__ import unicode_literals
import unittest
import frappe
from frappe.test_runner import make_test_records
from frappe.test_runner import make_test_objects
from erpnext.controllers.item_variant import (create_variant, ItemVariantExistsError,
InvalidItemAttributeValueError, get_variant)
from erpnext.stock.doctype.item.item import StockExistsForTemplate
from frappe.model.rename_doc import rename_doc
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
from erpnext.stock.get_item_details import get_item_details
test_ignore = ["BOM"]
test_dependencies = ["Warehouse"]
@ -53,7 +54,9 @@ class TestItem(unittest.TestCase):
return item
def test_get_item_details(self):
from erpnext.stock.get_item_details import get_item_details
# delete modified item price record and make as per test_records
frappe.db.sql("""delete from `tabItem Price`""")
to_check = {
"item_code": "_Test Item",
"item_name": "_Test Item",
@ -76,7 +79,8 @@ class TestItem(unittest.TestCase):
"conversion_factor": 1.0,
}
make_test_records("Item Price")
make_test_objects("Item Price")
print(frappe.get_all("Item Price"))
details = get_item_details({
"item_code": "_Test Item",
@ -88,7 +92,10 @@ class TestItem(unittest.TestCase):
"price_list_currency": "_Test Currency",
"plc_conversion_rate": 1,
"order_type": "Sales",
"customer": "_Test Customer"
"customer": "_Test Customer",
"conversion_factor": 1,
"price_list_uom_dependant": 1,
"ignore_pricing_rule": 1
})
for key, value in to_check.iteritems():