removed address_title from address and removed test
This commit is contained in:
parent
33020a63b8
commit
c02fbd22fa
@ -9,44 +9,43 @@ import unittest
|
||||
from frappe.test_runner import make_test_records
|
||||
|
||||
test_ignore = ["Price List"]
|
||||
|
||||
|
||||
test_records = frappe.get_test_records('Customer')
|
||||
|
||||
class TestCustomer(unittest.TestCase):
|
||||
def test_party_details(self):
|
||||
from erpnext.accounts.party import get_party_details
|
||||
|
||||
|
||||
to_check = {
|
||||
'address_display': '_Test Address Line 1\n_Test City\nIndia\nPhone: +91 0000000000',
|
||||
'selling_price_list': None,
|
||||
'customer_group': '_Test Customer Group',
|
||||
'contact_designation': None,
|
||||
'customer_address': '_Test Address-Office',
|
||||
'contact_department': None,
|
||||
'contact_email': 'test_contact_customer@example.com',
|
||||
'contact_mobile': None,
|
||||
'sales_team': [],
|
||||
'contact_display': '_Test Contact For _Test Customer',
|
||||
'contact_person': '_Test Contact For _Test Customer-_Test Customer',
|
||||
'territory': u'_Test Territory',
|
||||
'contact_phone': '+91 0000000000',
|
||||
'selling_price_list': None,
|
||||
'customer_group': '_Test Customer Group',
|
||||
'contact_designation': None,
|
||||
'customer_address': '_Test Address-Office',
|
||||
'contact_department': None,
|
||||
'contact_email': 'test_contact_customer@example.com',
|
||||
'contact_mobile': None,
|
||||
'sales_team': [],
|
||||
'contact_display': '_Test Contact For _Test Customer',
|
||||
'contact_person': '_Test Contact For _Test Customer-_Test Customer',
|
||||
'territory': u'_Test Territory',
|
||||
'contact_phone': '+91 0000000000',
|
||||
'customer_name': '_Test Customer'
|
||||
}
|
||||
|
||||
|
||||
make_test_records("Address")
|
||||
make_test_records("Contact")
|
||||
|
||||
|
||||
details = get_party_details("_Test Customer")
|
||||
|
||||
|
||||
for key, value in to_check.iteritems():
|
||||
self.assertEquals(value, details.get(key))
|
||||
|
||||
|
||||
def test_rename(self):
|
||||
frappe.rename_doc("Customer", "_Test Customer 1", "_Test Customer 1 Renamed")
|
||||
|
||||
self.assertTrue(frappe.db.exists("Customer", "_Test Customer 1 Renamed"))
|
||||
self.assertFalse(frappe.db.exists("Customer", "_Test Customer 1"))
|
||||
|
||||
frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
|
||||
|
||||
|
||||
frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1")
|
||||
|
||||
|
||||
|
@ -1,57 +1,57 @@
|
||||
{
|
||||
"autoname": "field:country",
|
||||
"creation": "2014-06-05 02:22:36.029850",
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"autoname": "field:country",
|
||||
"creation": "2014-06-05 02:22:36.029850",
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "Master",
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "country",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Country",
|
||||
"options": "Country",
|
||||
"permlevel": 0,
|
||||
"reqd": 0,
|
||||
"fieldname": "country",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Country",
|
||||
"options": "Country",
|
||||
"permlevel": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 1
|
||||
},
|
||||
},
|
||||
{
|
||||
"description": "This format is used if country specific format is not found",
|
||||
"fieldname": "is_default",
|
||||
"fieldtype": "Check",
|
||||
"in_list_view": 1,
|
||||
"label": "Is Default",
|
||||
"description": "This format is used if country specific format is not found",
|
||||
"fieldname": "is_default",
|
||||
"fieldtype": "Check",
|
||||
"in_list_view": 1,
|
||||
"label": "Is Default",
|
||||
"permlevel": 0
|
||||
},
|
||||
},
|
||||
{
|
||||
"default": "{{ address_title }}<br>\n{{ address_line1 }}<br>\n{% if address_line2 %}{{ address_line2 }}<br>{% endif -%}\n{{ city }}<br>\n{% if state %}{{ state }}<br>{% endif -%}\n{% if pincode %} PIN: {{ pincode }}<br>{% endif -%}\n{{ country }}<br>\n{% if phone %}Phone: {{ phone }}<br>{% endif -%}\n{% if fax %}Fax: {{ fax }}<br>{% endif -%}\n{% if email_id %}Email: {{ email_id }}<br>{% endif -%}\n",
|
||||
"description": "<h4>Default Template</h4>\n<p>Uses <a href=\"http://jinja.pocoo.org/docs/templates/\">Jinja Templating</a> and all the fields of Address (including Custom Fields if any) will be available</p>\n<pre><code>{{ address_title }}<br>\n{{ address_line1 }}<br>\n{% if address_line2 %}{{ address_line2 }}<br>{% endif -%}\n{{ city }}<br>\n{% if state %}{{ state }}<br>{% endif -%}\n{% if pincode %} PIN: {{ pincode }}<br>{% endif -%}\n{{ country }}<br>\n{% if phone %}Phone: {{ phone }}<br>{% endif -%}\n{% if fax %}Fax: {{ fax }}<br>{% endif -%}\n{% if email_id %}Email: {{ email_id }}<br>{% endif -%}\n</code></pre>",
|
||||
"fieldname": "template",
|
||||
"fieldtype": "Code",
|
||||
"label": "Template",
|
||||
"default": "{{ address_line1 }}<br>\n{% if address_line2 %}{{ address_line2 }}<br>{% endif -%}\n{{ city }}<br>\n{% if state %}{{ state }}<br>{% endif -%}\n{% if pincode %} PIN: {{ pincode }}<br>{% endif -%}\n{{ country }}<br>\n{% if phone %}Phone: {{ phone }}<br>{% endif -%}\n{% if fax %}Fax: {{ fax }}<br>{% endif -%}\n{% if email_id %}Email: {{ email_id }}<br>{% endif -%}\n",
|
||||
"description": "<h4>Default Template</h4>\n<p>Uses <a href=\"http://jinja.pocoo.org/docs/templates/\">Jinja Templating</a> and all the fields of Address (including Custom Fields if any) will be available</p>\n<pre><code>{{ address_title }}<br>\n{{ address_line1 }}<br>\n{% if address_line2 %}{{ address_line2 }}<br>{% endif -%}\n{{ city }}<br>\n{% if state %}{{ state }}<br>{% endif -%}\n{% if pincode %} PIN: {{ pincode }}<br>{% endif -%}\n{{ country }}<br>\n{% if phone %}Phone: {{ phone }}<br>{% endif -%}\n{% if fax %}Fax: {{ fax }}<br>{% endif -%}\n{% if email_id %}Email: {{ email_id }}<br>{% endif -%}\n</code></pre>",
|
||||
"fieldname": "template",
|
||||
"fieldtype": "Code",
|
||||
"label": "Template",
|
||||
"permlevel": 0
|
||||
}
|
||||
],
|
||||
"icon": "icon-map-marker",
|
||||
"modified": "2014-06-05 05:12:20.507364",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Utilities",
|
||||
"name": "Address Template",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
],
|
||||
"icon": "icon-map-marker",
|
||||
"modified": "2014-06-05 05:12:20.507364",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Utilities",
|
||||
"name": "Address Template",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"export": 1,
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 1,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"export": 1,
|
||||
"permlevel": 0,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user