From 6fe962e6ad2508a36b7ef79ebf9810086c44f6d7 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 8 Apr 2016 17:55:11 +0530 Subject: [PATCH] [test] fixed circular dependencies --- .../selling/doctype/customer/test_customer.py | 43 ------------------- .../doctype/quotation/test_quotation.py | 41 ++++++++++++++++++ .../utilities/doctype/address/test_address.py | 2 - 3 files changed, 41 insertions(+), 45 deletions(-) diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index 85b216bbac..9e53845f64 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -11,8 +11,6 @@ from erpnext.exceptions import PartyFrozen, PartyDisabled test_ignore = ["Price List"] -test_dependencies = ['Quotation'] - test_records = frappe.get_test_records('Customer') class TestCustomer(unittest.TestCase): @@ -113,47 +111,6 @@ class TestCustomer(unittest.TestCase): self.assertEquals("_Test Customer 1 - 1", duplicate_customer.name) self.assertEquals(test_customer_1.customer_name, duplicate_customer.customer_name) - def test_party_status_open(self): - from erpnext.selling.doctype.quotation.test_quotation import get_quotation_dict - - customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert() - self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active') - - quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert() - self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open') - - quotation.submit() - self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active') - - quotation.cancel() - quotation.delete() - customer.delete() - - def test_party_status_close(self): - from erpnext.selling.doctype.quotation.test_quotation import get_quotation_dict - - customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert() - self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active') - - # open quotation - quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert() - self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open') - - # close quotation (submit) - quotation.submit() - - quotation1 = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert() - - # still open - self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open') - - quotation.cancel() - quotation.delete() - - quotation1.delete() - - customer.delete() - def get_customer_dict(customer_name): return { "customer_group": "_Test Customer Group", diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 36cc472574..7a59dd72bf 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -68,6 +68,47 @@ class TestQuotation(unittest.TestCase): self.assertEquals(quotation.get("items")[0].rate, total_margin) si.save() + def test_party_status_open(self): + from erpnext.selling.doctype.customer.test_customer import get_customer_dict + + customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert() + self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active') + + quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert() + self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open') + + quotation.submit() + self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active') + + quotation.cancel() + quotation.delete() + customer.delete() + + def test_party_status_close(self): + from erpnext.selling.doctype.customer.test_customer import get_customer_dict + + customer = frappe.get_doc(get_customer_dict('Party Status Test')).insert() + self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Active') + + # open quotation + quotation = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert() + self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open') + + # close quotation (submit) + quotation.submit() + + quotation1 = frappe.get_doc(get_quotation_dict(customer=customer.name)).insert() + + # still open + self.assertEquals(frappe.db.get_value('Customer', customer.name, 'status'), 'Open') + + quotation.cancel() + quotation.delete() + + quotation1.delete() + + customer.delete() + test_records = frappe.get_test_records('Quotation') def get_quotation_dict(customer=None, item_code=None): diff --git a/erpnext/utilities/doctype/address/test_address.py b/erpnext/utilities/doctype/address/test_address.py index 26634b81cc..36f2535fa1 100644 --- a/erpnext/utilities/doctype/address/test_address.py +++ b/erpnext/utilities/doctype/address/test_address.py @@ -6,8 +6,6 @@ from __future__ import unicode_literals import frappe test_records = frappe.get_test_records('Address') -test_dependencies = ['Customer'] - import unittest import frappe