kirthi
June 6, 2016, 5:15am
#1
When we export the custom field from devsetup to the production server through fixtures, the field doesn’t get displayed in the form. The field is present in the custom_field.json and yet it deosnt reflect in the UI., I have done bench reload-doc as well, and still no update.
I’m wondering what 's going on…why wouldnt it load from the json?
Kirthi
sagar
June 6, 2016, 5:31am
#2
Hello @kirthi ,
Try The “bench migrate” and “bench start” command
i hope it will help
Thanks
kirthi
June 6, 2016, 6:00am
#3
@sagar It works. But then, I just realized that when i run bench run-tests it all goes away again.
Has someone experienced this with bench run-tests?
kirthi
June 6, 2016, 6:02am
#4
bench run-tests always fails since it cannot find the custom fields…I wonder if this is a system issue or something to do with my customizations?
@kirthi
bench run-tests
delete all custom fields before execution.
so you have to sync fixtures first while executing test cases.
ref:
import unittest
from frappe.utils import cint, cstr, flt
from frappe.utils.fixtures import sync_fixtures
from erpnext_shopify.sync_orders import create_order, valid_customer_and_product
from erpnext_shopify.sync_products import make_item
from erpnext_shopify.sync_customers import create_customer
class ShopifySettings(unittest.TestCase):
def setUp(self):
frappe.set_user("Administrator")
sync_fixtures("erpnext_shopify")
frappe.reload_doctype("Customer")
frappe.reload_doctype("Sales Order")
frappe.reload_doctype("Delivery Note")
frappe.reload_doctype("Sales Invoice")
self.setup_shopify()
def setup_shopify(self):
shopify_settings = frappe.get_doc("Shopify Settings")
shopify_settings.taxes = []
kirthi
June 13, 2016, 2:44pm
#6
Thanks @saurabh6790 That was it.