Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 1 | $.extend(frappe.test_data, { |
Rushabh Mehta | 9d27cf3 | 2017-07-20 15:35:03 +0530 | [diff] [blame] | 2 | // "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 Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 9 | "Customer": { |
| 10 | "Test Customer 1": [ |
| 11 | {customer_name: "Test Customer 1"} |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 12 | ], |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 13 | "Test Customer 2": [ |
| 14 | {customer_name: "Test Customer 2"} |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 15 | ], |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 16 | "Test Customer 3": [ |
| 17 | {customer_name: "Test Customer 3"} |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 18 | ], |
| 19 | }, |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 20 | "Item": { |
| 21 | "Test Product 1": [ |
| 22 | {item_code: "Test Product 1"}, |
| 23 | {item_group: "Products"}, |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 24 | {is_stock_item: 1}, |
| 25 | {standard_rate: 100}, |
| 26 | {opening_stock: 100}, |
| 27 | ], |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 28 | "Test Product 2": [ |
| 29 | {item_code: "Test Product 2"}, |
| 30 | {item_group: "Products"}, |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 31 | {is_stock_item: 1}, |
| 32 | {standard_rate: 150}, |
| 33 | {opening_stock: 200}, |
| 34 | ], |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 35 | "Test Product 3": [ |
| 36 | {item_code: "Test Product 3"}, |
| 37 | {item_group: "Products"}, |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 38 | {is_stock_item: 1}, |
| 39 | {standard_rate: 250}, |
| 40 | {opening_stock: 100}, |
| 41 | ], |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 42 | "Test Service 1": [ |
| 43 | {item_code: "Test Service 1"}, |
| 44 | {item_group: "Services"}, |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 45 | {is_stock_item: 0}, |
| 46 | {standard_rate: 200} |
| 47 | ], |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 48 | "Test Service 2": [ |
| 49 | {item_code: "Test Service 2"}, |
| 50 | {item_group: "Services"}, |
Rushabh Mehta | 43ef4e9 | 2017-07-03 11:53:07 +0530 | [diff] [blame] | 51 | {is_stock_item: 0}, |
| 52 | {standard_rate: 300} |
| 53 | ] |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 54 | }, |
| 55 | "Lead": { |
| 56 | "LEAD-00001": [ |
| 57 | {lead_name: "Test Lead 1"} |
| 58 | ], |
| 59 | "LEAD-00002": [ |
| 60 | {lead_name: "Test Lead 2"} |
| 61 | ], |
| 62 | "LEAD-00003": [ |
| 63 | {lead_name: "Test Lead 3"} |
| 64 | ] |
| 65 | }, |
| 66 | "Address": { |
| 67 | "Test1-Billing": [ |
| 68 | {address_title:"Test1"}, |
| 69 | {address_type: "Billing"}, |
| 70 | {address_line1: "Billing Street 1"}, |
| 71 | {city: "Billing City 1"}, |
| 72 | {links: [ |
| 73 | [ |
| 74 | {link_doctype: "Customer"}, |
| 75 | {link_name: "Test Customer 1"} |
| 76 | ] |
| 77 | ]} |
| 78 | ], |
| 79 | "Test1-Shipping": [ |
| 80 | {address_title:"Test1"}, |
| 81 | {address_type: "Shipping"}, |
| 82 | {address_line1: "Shipping Street 1"}, |
| 83 | {city: "Shipping City 1"}, |
| 84 | {links: [ |
| 85 | [ |
| 86 | {link_doctype: "Customer"}, |
| 87 | {link_name: "Test Customer 1"} |
| 88 | ] |
| 89 | ]} |
| 90 | ], |
| 91 | "Test1-Warehouse": [ |
| 92 | {address_title:"Test1"}, |
| 93 | {address_type: "Warehouse"}, |
| 94 | {address_line1: "Warehouse Street 1"}, |
| 95 | {city: "Warehouse City 1"}, |
| 96 | {links: [ |
| 97 | [ |
| 98 | {link_doctype: "Customer"}, |
| 99 | {link_name: "Test Customer 1"} |
| 100 | ] |
| 101 | ]} |
| 102 | ], |
| 103 | "Test2-Billing": [ |
| 104 | {address_title:"Test2"}, |
| 105 | {address_type: "Billing"}, |
| 106 | {address_line1: "Billing Street 2"}, |
| 107 | {city: "Billing City 2"}, |
| 108 | {links: [ |
| 109 | [ |
| 110 | {link_doctype: "Customer"}, |
| 111 | {link_name: "Test Customer 2"} |
| 112 | ] |
| 113 | ]} |
| 114 | ], |
| 115 | "Test2-Shipping": [ |
| 116 | {address_title:"Test2"}, |
| 117 | {address_type: "Shipping"}, |
| 118 | {address_line1: "Shipping Street 2"}, |
| 119 | {city: "Shipping City 2"}, |
| 120 | {links: [ |
| 121 | [ |
| 122 | {link_doctype: "Customer"}, |
| 123 | {link_name: "Test Customer 2"} |
| 124 | ] |
| 125 | ]} |
| 126 | ], |
| 127 | "Test2-Warehouse": [ |
| 128 | {address_title:"Test2"}, |
| 129 | {address_type: "Warehouse"}, |
| 130 | {address_line1: "Warehouse Street 2"}, |
| 131 | {city: "Warehouse City 2"}, |
| 132 | {links: [ |
| 133 | [ |
| 134 | {link_doctype: "Customer"}, |
| 135 | {link_name: "Test Customer 2"} |
| 136 | ] |
| 137 | ]} |
| 138 | ] |
| 139 | }, |
| 140 | "Contact": { |
| 141 | "Contact 1-Test Customer 1": [ |
| 142 | {first_name: "Contact 1"}, |
| 143 | {links: [ |
| 144 | [ |
| 145 | {link_doctype: "Customer"}, |
| 146 | {link_name: "Test Customer 1"} |
| 147 | ] |
| 148 | ]} |
| 149 | ], |
| 150 | "Contact 2-Test Customer 1": [ |
| 151 | {first_name: "Contact 2"}, |
| 152 | {links: [ |
| 153 | [ |
| 154 | {link_doctype: "Customer"}, |
| 155 | {link_name: "Test Customer 1"} |
| 156 | ] |
| 157 | ]} |
| 158 | ], |
| 159 | "Contact 1-Test Customer 2": [ |
| 160 | {first_name: "Contact 1"}, |
| 161 | {links: [ |
| 162 | [ |
| 163 | {link_doctype: "Customer"}, |
| 164 | {link_name: "Test Customer 2"} |
| 165 | ] |
| 166 | ]} |
| 167 | ], |
| 168 | "Contact 2-Test Customer 2": [ |
| 169 | {first_name: "Contact 2"}, |
| 170 | {links: [ |
| 171 | [ |
| 172 | {link_doctype: "Customer"}, |
| 173 | {link_name: "Test Customer 2"} |
| 174 | ] |
| 175 | ]} |
| 176 | ], |
| 177 | }, |
| 178 | "Price List": { |
| 179 | "Test-Buying-USD": [ |
| 180 | {price_list_name: "Test-Buying-USD"}, |
| 181 | {currency: "USD"}, |
| 182 | {buying: "1"} |
| 183 | ], |
| 184 | "Test-Buying-EUR": [ |
| 185 | {price_list_name: "Test-Buying-EUR"}, |
| 186 | {currency: "EUR"}, |
| 187 | {buying: "1"} |
| 188 | ], |
| 189 | "Test-Selling-USD": [ |
| 190 | {price_list_name: "Test-Selling-USD"}, |
| 191 | {currency: "USD"}, |
| 192 | {selling: "1"} |
| 193 | ], |
| 194 | "Test-Selling-EUR": [ |
| 195 | {price_list_name: "Test-Selling-EUR"}, |
| 196 | {currency: "EUR"}, |
| 197 | {selling: "1"} |
| 198 | ], |
| 199 | }, |
| 200 | "Terms and Conditions": { |
| 201 | "Test Term 1": [ |
| 202 | {title: "Test Term 1"} |
| 203 | ], |
| 204 | "Test Term 2": [ |
| 205 | {title: "Test Term 2"} |
| 206 | ] |
| 207 | }, |
Rushabh Mehta | 9d27cf3 | 2017-07-20 15:35:03 +0530 | [diff] [blame] | 208 | }); |
| 209 | |
| 210 | |
| 211 | // this is a script that creates all fixtures |
| 212 | // called as a test |
| 213 | QUnit.module('fixture'); |
| 214 | |
| 215 | QUnit.test('Make fixtures', assert => { |
| 216 | // create all fixtures first |
| 217 | assert.expect(0); |
| 218 | let done = assert.async(); |
| 219 | let tasks = []; |
| 220 | Object.keys(frappe.test_data).forEach(function(doctype) { |
| 221 | tasks.push(function() { return frappe.tests.setup_doctype(doctype); }); |
| 222 | }); |
| 223 | frappe.run_serially(tasks).then(() => done()); |
Shivam Mishra | 3fe5ecc | 2017-07-11 10:33:07 +0530 | [diff] [blame] | 224 | }); |