@@ -0,0 +1,842 @@
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors%0A# License: GNU General Public License v3. See license.txt%0A%0A%0Afrom __future__ import unicode_literals%0Aimport unittest%0Aimport frappe%0A%0Atest_records = frappe.get_test_records('BOM')%0A%0Aclass TestBOMUpdateTool(unittest.TestCase):%0A%09def test_replace_bom(self):%0A%09%09current_bom = %22BOM-_Test Item Home Desktop Manufactured-001%22%0A%0A%09%09bom_doc = frappe.copy_doc(test_records%5B0%5D)%0A%09%09bom_doc.items%5B1%5D.item_code = %22_Test Item%22%0A%09%09bom_doc.insert()%0A%0A%09%09update_tool = frappe.get_doc(%22BOM Update Tool%22)%0A%09%09update_tool.current_bom = current_bom%0A%09%09update_tool.new_bom = bom_doc.name%0A%09%09update_tool.replace_bom()%0A%0A%09%09self.assertFalse(frappe.db.sql(%22select name from %60tabBOM Item%60 where bom_no=%25s%22, current_bom))%0A%09%09self.assertTrue(frappe.db.sql(%22select name from %60tabBOM Item%60 where bom_no=%25s%22, bom_doc.name))

Test case added for replacing BOM