mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 18:04:46 +00:00
[bean] [mandatory] fixes in test cases
This commit is contained in:
@@ -55,6 +55,7 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
self.assertEquals(pi[0]["doctype"], "Purchase Invoice")
|
self.assertEquals(pi[0]["doctype"], "Purchase Invoice")
|
||||||
self.assertEquals(len(pi), len(test_records[0]))
|
self.assertEquals(len(pi), len(test_records[0]))
|
||||||
|
|
||||||
|
pi[0].bill_no = "NA"
|
||||||
webnotes.bean(pi).insert()
|
webnotes.bean(pi).insert()
|
||||||
|
|
||||||
def test_subcontracting(self):
|
def test_subcontracting(self):
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ class TestPurchaseOrder(unittest.TestCase):
|
|||||||
po[0]["naming_series"] = "_T-Purchase Order-"
|
po[0]["naming_series"] = "_T-Purchase Order-"
|
||||||
|
|
||||||
for doc in po:
|
for doc in po:
|
||||||
if doc.parentfield=="purchase_order_items":
|
if doc.get("item_code"):
|
||||||
doc.schedule_date = "2013-04-12"
|
doc["schedule_date"] = "2013-04-12"
|
||||||
|
|
||||||
webnotes.bean(po).insert()
|
webnotes.bean(po).insert()
|
||||||
|
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ class DocType(TransactionBase):
|
|||||||
return obj.doclist
|
return obj.doclist
|
||||||
|
|
||||||
# delete from doclist
|
# delete from doclist
|
||||||
obj.doclist = filter(lambda d: d.name not in delete_list, obj.doclist)
|
obj.doclist = webnotes.doclist(filter(lambda d: d.name not in delete_list, obj.doclist))
|
||||||
|
|
||||||
# delete from db
|
# delete from db
|
||||||
webnotes.conn.sql("""\
|
webnotes.conn.sql("""\
|
||||||
|
|||||||
@@ -59,11 +59,12 @@ class TestSalesOrder(unittest.TestCase):
|
|||||||
|
|
||||||
def create_so(self, so_doclist = None):
|
def create_so(self, so_doclist = None):
|
||||||
if not so_doclist:
|
if not so_doclist:
|
||||||
so_doclist =test_records[0]
|
so_doclist = test_records[0]
|
||||||
|
|
||||||
w = webnotes.bean(copy=so_doclist)
|
w = webnotes.bean(copy=so_doclist)
|
||||||
w.insert()
|
w.insert()
|
||||||
w.submit()
|
w.submit()
|
||||||
|
|
||||||
return w
|
return w
|
||||||
|
|
||||||
def create_dn_against_so(self, so, delivered_qty=0):
|
def create_dn_against_so(self, so, delivered_qty=0):
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ test_records = [
|
|||||||
"doctype": "Currency Exchange",
|
"doctype": "Currency Exchange",
|
||||||
"from_currency": "USD",
|
"from_currency": "USD",
|
||||||
"to_currency": "INR",
|
"to_currency": "INR",
|
||||||
"exchange_rate": 1
|
"exchange_rate": 60.0
|
||||||
}],
|
}],
|
||||||
[{
|
[{
|
||||||
"doctype": "Currency Exchange",
|
"doctype": "Currency Exchange",
|
||||||
|
|||||||
@@ -363,8 +363,8 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
def _test_delivery_note_return_against_sales_order(self, item_code, delivered_qty, returned_qty):
|
def _test_delivery_note_return_against_sales_order(self, item_code, delivered_qty, returned_qty):
|
||||||
self._insert_material_receipt()
|
self._insert_material_receipt()
|
||||||
|
|
||||||
from selling.doctype.sales_order.test_sales_order \
|
from selling.doctype.sales_order.test_sales_order import test_records as sales_order_test_records
|
||||||
import test_records as sales_order_test_records, make_sales_invoice, make_delivery_note
|
from selling.doctype.sales_order.sales_order import make_sales_invoice, make_delivery_note
|
||||||
|
|
||||||
actual_qty_0 = self._get_actual_qty()
|
actual_qty_0 = self._get_actual_qty()
|
||||||
|
|
||||||
@@ -445,6 +445,7 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
d.cost_center = "_Test Cost Center - _TC"
|
d.cost_center = "_Test Cost Center - _TC"
|
||||||
|
|
||||||
pi.run_method("calculate_taxes_and_totals")
|
pi.run_method("calculate_taxes_and_totals")
|
||||||
|
pi.doc.bill_no = "NA"
|
||||||
pi.insert()
|
pi.insert()
|
||||||
pi.submit()
|
pi.submit()
|
||||||
|
|
||||||
@@ -544,6 +545,7 @@ class TestStockEntry(unittest.TestCase):
|
|||||||
d.cost_center = "_Test Cost Center - _TC"
|
d.cost_center = "_Test Cost Center - _TC"
|
||||||
|
|
||||||
pi.run_method("calculate_taxes_and_totals")
|
pi.run_method("calculate_taxes_and_totals")
|
||||||
|
pi.doc.bill_no = "NA"
|
||||||
pi.insert()
|
pi.insert()
|
||||||
pi.submit()
|
pi.submit()
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ test_records = [
|
|||||||
"doctype": "Warehouse",
|
"doctype": "Warehouse",
|
||||||
"warehouse_name": "_Test Warehouse 1",
|
"warehouse_name": "_Test Warehouse 1",
|
||||||
"warehouse_type": "_Test Warehouse Type",
|
"warehouse_type": "_Test Warehouse Type",
|
||||||
|
"company": "_Test Company"
|
||||||
}],
|
}],
|
||||||
[{
|
[{
|
||||||
"doctype": "Warehouse",
|
"doctype": "Warehouse",
|
||||||
|
|||||||
Reference in New Issue
Block a user