def test_make_supplier_quotation(self): from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation rfq = make_request_for_quotation() sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier) sq.submit() sq1 = make_supplier_quotation(rfq.name, rfq.get('suppliers')[1].supplier) sq1.submit() self.assertEquals(sq.supplier, rfq.get('suppliers')[0].supplier) self.assertEquals(sq.get('items')[0].request_for_quotation, rfq.name) self.assertEquals(sq.get('items')[0].item_code, "_Test Item") self.assertEquals(sq.get('items')[0].qty, 5) self.assertEquals(sq1.supplier, rfq.get('suppliers')[1].supplier) self.assertEquals(sq1.get('items')[0].request_for_quotation, rfq.name) self.assertEquals(sq1.get('items')[0].item_code, "_Test Item") self.assertEquals(sq1.get('items')[0].qty, 5)
def test_make_supplier_quotation(self): rfq = make_request_for_quotation() sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier) sq.submit() sq1 = make_supplier_quotation(rfq.name, rfq.get('suppliers')[1].supplier) sq1.submit() self.assertEqual(sq.supplier, rfq.get('suppliers')[0].supplier) self.assertEqual(sq.get('items')[0].request_for_quotation, rfq.name) self.assertEqual(sq.get('items')[0].item_code, "_Test Item") self.assertEqual(sq.get('items')[0].qty, 5) self.assertEqual(sq1.supplier, rfq.get('suppliers')[1].supplier) self.assertEqual(sq1.get('items')[0].request_for_quotation, rfq.name) self.assertEqual(sq1.get('items')[0].item_code, "_Test Item") self.assertEqual(sq1.get('items')[0].qty, 5)
def test_make_supplier_quotation(self): from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation rfq = make_request_for_quotation() sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier) sq.submit() sq1 = make_supplier_quotation(rfq.name, rfq.get('suppliers')[1].supplier) sq1.submit() self.assertEquals(sq.supplier, rfq.get('suppliers')[0].supplier) self.assertEquals(sq.get('items')[0].request_for_quotation, rfq.name) self.assertEquals(sq.get('items')[0].item_code, "_Test Item") self.assertEquals(sq.get('items')[0].qty, 5) self.assertEquals(sq1.supplier, rfq.get('suppliers')[1].supplier) self.assertEquals(sq1.get('items')[0].request_for_quotation, rfq.name) self.assertEquals(sq1.get('items')[0].item_code, "_Test Item") self.assertEquals(sq1.get('items')[0].qty, 5)
def test_quote_status(self): from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation rfq = make_request_for_quotation() self.assertEquals(rfq.get('suppliers')[0].quote_status, 'Pending') self.assertEquals(rfq.get('suppliers')[1].quote_status, 'Pending') # Submit the first supplier quotation sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier) sq.submit() # No Quote first supplier quotation rfq.get('suppliers')[1].no_quote = 1 rfq.get('suppliers')[1].quote_status = 'No Quote' rfq.update_rfq_supplier_status() #rfq.get('suppliers')[1].supplier) self.assertEquals(rfq.get('suppliers')[0].quote_status, 'Received') self.assertEquals(rfq.get('suppliers')[1].quote_status, 'No Quote')
def test_quote_status(self): rfq = make_request_for_quotation() self.assertEqual(rfq.get('suppliers')[0].quote_status, 'Pending') self.assertEqual(rfq.get('suppliers')[1].quote_status, 'Pending') # Submit the first supplier quotation sq = make_supplier_quotation(rfq.name, rfq.get('suppliers')[0].supplier) sq.submit() # No Quote first supplier quotation rfq.get('suppliers')[1].no_quote = 1 rfq.get('suppliers')[1].quote_status = 'No Quote' rfq.update_rfq_supplier_status() #rfq.get('suppliers')[1].supplier) self.assertEqual(rfq.get('suppliers')[0].quote_status, 'Received') self.assertEqual(rfq.get('suppliers')[1].quote_status, 'No Quote')
def test_make_supplier_quotation_with_special_characters(self): frappe.delete_doc_if_exists("Supplier", "_Test Supplier '1", force=1) supplier = frappe.new_doc("Supplier") supplier.supplier_name = "_Test Supplier '1" supplier.supplier_group = "_Test Supplier Group" supplier.insert() rfq = make_request_for_quotation(supplier_data=supplier_wt_appos) sq = make_supplier_quotation(rfq.name, supplier_wt_appos[0].get("supplier")) sq.submit() frappe.form_dict = frappe.local("form_dict") frappe.form_dict.name = rfq.name self.assertEqual( check_supplier_has_docname_access( supplier_wt_appos[0].get('supplier')), True) # reset form_dict frappe.form_dict.name = None
def test_make_supplier_quotation_with_special_characters(self): from erpnext.buying.doctype.request_for_quotation.request_for_quotation import make_supplier_quotation frappe.delete_doc_if_exists("Supplier", "_Test Supplier '1", force=1) supplier = frappe.new_doc("Supplier") supplier.supplier_name = "_Test Supplier '1" supplier.supplier_type = "_Test Supplier Type" supplier.insert() rfq = make_request_for_quotation(supplier_wt_appos) sq = make_supplier_quotation(rfq.name, supplier_wt_appos[0].get("supplier")) sq.submit() frappe.form_dict = frappe.local("form_dict") frappe.form_dict.name = rfq.name self.assertEqual( check_supplier_has_docname_access(supplier_wt_appos[0].get('supplier')), True ) # reset form_dict frappe.form_dict.name = None