Rushabh Mehta | 982be9f | 2017-01-17 17:57:19 +0530 | [diff] [blame] | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | |
| 6 | import frappe |
| 7 | |
| 8 | def create_test_contact_and_address(): |
Rushabh Mehta | a0c41b7 | 2017-01-18 14:14:20 +0530 | [diff] [blame] | 9 | frappe.db.sql('delete from tabContact') |
| 10 | frappe.db.sql('delete from tabAddress') |
| 11 | frappe.db.sql('delete from `tabDynamic Link`') |
Rushabh Mehta | 982be9f | 2017-01-17 17:57:19 +0530 | [diff] [blame] | 12 | |
Rushabh Mehta | a0c41b7 | 2017-01-18 14:14:20 +0530 | [diff] [blame] | 13 | frappe.get_doc(dict( |
| 14 | doctype='Address', |
| 15 | address_title='_Test Address for Customer', |
| 16 | address_type='Office', |
| 17 | address_line1='Station Road', |
| 18 | city='_Test City', |
| 19 | state='Test State', |
| 20 | country='India', |
| 21 | links = [dict( |
| 22 | link_doctype='Customer', |
| 23 | link_name='_Test Customer' |
| 24 | )] |
| 25 | )).insert() |
| 26 | |
| 27 | frappe.get_doc(dict( |
| 28 | doctype='Contact', |
| 29 | email_id='test_contact_customer@example.com', |
| 30 | phone='+91 0000000000', |
| 31 | first_name='_Test Contact for _Test Customer', |
| 32 | links = [dict( |
| 33 | link_doctype='Customer', |
| 34 | link_name='_Test Customer' |
| 35 | )] |
| 36 | )).insert() |