[fix] test_shopping_cart.py

This commit is contained in:
Rushabh Mehta 2017-01-17 22:15:17 +05:30
parent d14a6c058a
commit 8f55d6bf3a
2 changed files with 5 additions and 4 deletions

View File

@ -368,7 +368,8 @@ def get_debtors_account(cart_settings):
return debtors_account_name return debtors_account_name
def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_page_length=20, party=None): def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_page_length=20,
party=None):
if not party: if not party:
party = get_party() party = get_party()
@ -380,8 +381,8 @@ def get_address_docs(doctype=None, txt=None, filters=None, limit_start=0, limit_
out = [] out = []
for address_name in address_names: for a in address_names:
address = frappe.get_doc('Address', address_name) address = frappe.get_doc('Address', a.parent)
address.display = get_address_display(address.as_dict()) address.display = get_address_display(address.as_dict())
out.append(address) out.append(address)

View File

@ -14,6 +14,7 @@ class TestShoppingCart(unittest.TestCase):
""" """
def setUp(self): def setUp(self):
frappe.set_user("Administrator") frappe.set_user("Administrator")
create_test_contact_and_address()
self.enable_shopping_cart() self.enable_shopping_cart()
def tearDown(self): def tearDown(self):
@ -185,7 +186,6 @@ class TestShoppingCart(unittest.TestCase):
frappe.set_user("test_cart_user@example.com") frappe.set_user("test_cart_user@example.com")
def login_as_customer(self): def login_as_customer(self):
create_test_contact_and_address()
self.create_user_if_not_exists("test_contact_customer@example.com", self.create_user_if_not_exists("test_contact_customer@example.com",
"_Test Contact For _Test Customer") "_Test Contact For _Test Customer")
frappe.set_user("test_contact_customer@example.com") frappe.set_user("test_contact_customer@example.com")