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
4 changed files with 13 additions and 5 deletions

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():