blob: 8c9e50884af11b124e113bc9a31a180049f7560e [file] [log] [blame]
Rushabh Mehta43ef4e92017-07-03 11:53:07 +05301$.extend(frappe.test_data, {
Rushabh Mehta9d27cf32017-07-20 15:35:03 +05302 // "Fiscal Year": {
3 // "2017-18": [
4 // {"year": "2017-18"},
5 // {"year_start_date": "2017-04-01"},
6 // {"year_end_date": "2018-03-31"},
7 // ]
8 // },
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +05309 "Customer": {
10 "Test Customer 1": [
11 {customer_name: "Test Customer 1"}
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053012 ],
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053013 "Test Customer 2": [
14 {customer_name: "Test Customer 2"}
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053015 ],
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053016 "Test Customer 3": [
17 {customer_name: "Test Customer 3"}
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053018 ],
19 },
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053020 "Item": {
21 "Test Product 1": [
22 {item_code: "Test Product 1"},
23 {item_group: "Products"},
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053024 {is_stock_item: 1},
25 {standard_rate: 100},
26 {opening_stock: 100},
27 ],
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053028 "Test Product 2": [
29 {item_code: "Test Product 2"},
30 {item_group: "Products"},
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053031 {is_stock_item: 1},
32 {standard_rate: 150},
33 {opening_stock: 200},
34 ],
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053035 "Test Product 3": [
36 {item_code: "Test Product 3"},
37 {item_group: "Products"},
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053038 {is_stock_item: 1},
39 {standard_rate: 250},
40 {opening_stock: 100},
Vishal Dhayaguded3e22ac2017-09-14 12:51:22 +053041 {stock_uom:'Kg'}
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053042 ],
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053043 "Test Service 1": [
44 {item_code: "Test Service 1"},
45 {item_group: "Services"},
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053046 {is_stock_item: 0},
47 {standard_rate: 200}
48 ],
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053049 "Test Service 2": [
50 {item_code: "Test Service 2"},
51 {item_group: "Services"},
Rushabh Mehta43ef4e92017-07-03 11:53:07 +053052 {is_stock_item: 0},
53 {standard_rate: 300}
54 ]
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +053055 },
56 "Lead": {
57 "LEAD-00001": [
58 {lead_name: "Test Lead 1"}
59 ],
60 "LEAD-00002": [
61 {lead_name: "Test Lead 2"}
62 ],
63 "LEAD-00003": [
64 {lead_name: "Test Lead 3"}
65 ]
66 },
67 "Address": {
68 "Test1-Billing": [
69 {address_title:"Test1"},
70 {address_type: "Billing"},
71 {address_line1: "Billing Street 1"},
72 {city: "Billing City 1"},
73 {links: [
74 [
75 {link_doctype: "Customer"},
76 {link_name: "Test Customer 1"}
77 ]
78 ]}
79 ],
80 "Test1-Shipping": [
81 {address_title:"Test1"},
82 {address_type: "Shipping"},
83 {address_line1: "Shipping Street 1"},
84 {city: "Shipping City 1"},
85 {links: [
86 [
87 {link_doctype: "Customer"},
88 {link_name: "Test Customer 1"}
89 ]
90 ]}
91 ],
92 "Test1-Warehouse": [
93 {address_title:"Test1"},
94 {address_type: "Warehouse"},
95 {address_line1: "Warehouse Street 1"},
96 {city: "Warehouse City 1"},
97 {links: [
98 [
99 {link_doctype: "Customer"},
100 {link_name: "Test Customer 1"}
101 ]
102 ]}
103 ],
104 "Test2-Billing": [
105 {address_title:"Test2"},
106 {address_type: "Billing"},
107 {address_line1: "Billing Street 2"},
108 {city: "Billing City 2"},
109 {links: [
110 [
111 {link_doctype: "Customer"},
112 {link_name: "Test Customer 2"}
113 ]
114 ]}
115 ],
116 "Test2-Shipping": [
117 {address_title:"Test2"},
118 {address_type: "Shipping"},
119 {address_line1: "Shipping Street 2"},
120 {city: "Shipping City 2"},
121 {links: [
122 [
123 {link_doctype: "Customer"},
124 {link_name: "Test Customer 2"}
125 ]
126 ]}
127 ],
128 "Test2-Warehouse": [
129 {address_title:"Test2"},
130 {address_type: "Warehouse"},
131 {address_line1: "Warehouse Street 2"},
132 {city: "Warehouse City 2"},
133 {links: [
134 [
135 {link_doctype: "Customer"},
136 {link_name: "Test Customer 2"}
137 ]
138 ]}
139 ]
140 },
141 "Contact": {
142 "Contact 1-Test Customer 1": [
143 {first_name: "Contact 1"},
144 {links: [
145 [
146 {link_doctype: "Customer"},
147 {link_name: "Test Customer 1"}
148 ]
149 ]}
150 ],
151 "Contact 2-Test Customer 1": [
152 {first_name: "Contact 2"},
153 {links: [
154 [
155 {link_doctype: "Customer"},
156 {link_name: "Test Customer 1"}
157 ]
158 ]}
159 ],
160 "Contact 1-Test Customer 2": [
161 {first_name: "Contact 1"},
162 {links: [
163 [
164 {link_doctype: "Customer"},
165 {link_name: "Test Customer 2"}
166 ]
167 ]}
168 ],
169 "Contact 2-Test Customer 2": [
170 {first_name: "Contact 2"},
171 {links: [
172 [
173 {link_doctype: "Customer"},
174 {link_name: "Test Customer 2"}
175 ]
176 ]}
177 ],
178 },
179 "Price List": {
180 "Test-Buying-USD": [
181 {price_list_name: "Test-Buying-USD"},
182 {currency: "USD"},
183 {buying: "1"}
184 ],
185 "Test-Buying-EUR": [
186 {price_list_name: "Test-Buying-EUR"},
187 {currency: "EUR"},
188 {buying: "1"}
189 ],
190 "Test-Selling-USD": [
191 {price_list_name: "Test-Selling-USD"},
192 {currency: "USD"},
193 {selling: "1"}
194 ],
195 "Test-Selling-EUR": [
196 {price_list_name: "Test-Selling-EUR"},
197 {currency: "EUR"},
198 {selling: "1"}
199 ],
200 },
201 "Terms and Conditions": {
202 "Test Term 1": [
203 {title: "Test Term 1"}
204 ],
205 "Test Term 2": [
206 {title: "Test Term 2"}
207 ]
208 },
Nabin Haitded8d112017-08-17 14:05:57 +0530209 "Item Price": {
210 "ITEM-PRICE-00001": [
211 {item_code: 'Test Product 1'},
212 {price_list: '_Test Price List'},
213 {price_list_rate: 100}
214 ],
215 "ITEM-PRICE-00002": [
216 {item_code: 'Test Product 2'},
217 {price_list: '_Test Price List'},
218 {price_list_rate: 200}
219 ]
tunde541d3f92017-09-25 17:41:22 +0100220 },
221 "Payment Term": {
222 "_Test Payment Term": [
223 {payment_term_name: '_Test Payment Term'},
224 {due_date_based_on: 'Day(s) after invoice date'},
225 {invoice_portion: 100},
226 {credit_days: 0}
227 ]
228 },
229 "Payment Terms Template": {
230 "_Test Payment Term Template UI": [
231 {template_name: "_Test Payment Term Template UI"},
232 {terms: [
233 [
234 {payment_term: '_Test Payment Term'},
235 {invoice_portion: 100}
236 ]
237 ]}
238 ]
Nabin Haitded8d112017-08-17 14:05:57 +0530239 }
Rushabh Mehta9d27cf32017-07-20 15:35:03 +0530240});
241
242
243// this is a script that creates all fixtures
244// called as a test
245QUnit.module('fixture');
246
247QUnit.test('Make fixtures', assert => {
248 // create all fixtures first
249 assert.expect(0);
250 let done = assert.async();
251 let tasks = [];
252 Object.keys(frappe.test_data).forEach(function(doctype) {
Rushabh Mehtabc4e2cd2017-10-17 12:30:34 +0530253 tasks.push(function() {
254 return frappe.tests.setup_doctype(doctype, frappe.test_data[doctype]);
255 });
Rushabh Mehta9d27cf32017-07-20 15:35:03 +0530256 });
257 frappe.run_serially(tasks).then(() => done());
Shivam Mishra3fe5ecc2017-07-11 10:33:07 +0530258});