blob: dfd3ed76bcbefb9a044a4dd4b5da0d60c6b45adc [file] [log] [blame]
Rushabh Mehta982be9f2017-01-17 17:57:19 +05301# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5
6import frappe
7
8def create_test_contact_and_address():
Rushabh Mehtaa0c41b72017-01-18 14:14:20 +05309 frappe.db.sql('delete from tabContact')
10 frappe.db.sql('delete from tabAddress')
11 frappe.db.sql('delete from `tabDynamic Link`')
Rushabh Mehta982be9f2017-01-17 17:57:19 +053012
Himanshu25ab1e42019-09-30 10:08:15 +053013 frappe.get_doc({
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": [
22 {
23 "link_doctype": "Customer",
24 "link_name": "_Test Customer"
25 }
26 ]
27 }).insert()
Rushabh Mehtaa0c41b72017-01-18 14:14:20 +053028
Himanshu25ab1e42019-09-30 10:08:15 +053029 contact = frappe.get_doc({
30 "doctype": 'Contact',
31 "first_name": "_Test Contact for _Test Customer",
32 "links": [
33 {
34 "link_doctype": "Customer",
35 "link_name": "_Test Customer"
36 }
37 ]
38 })
39 contact.add_email("test_contact_customer@example.com", is_primary=True)
40 contact.add_phone("+91 0000000000", is_primary_phone=True)
41 contact.insert()