ported test data and test purchase receipt from aii
diff --git a/stock/doctype/purchase_receipt/test_purchase_receipt.py b/stock/doctype/purchase_receipt/test_purchase_receipt.py
new file mode 100644
index 0000000..98418d0
--- /dev/null
+++ b/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -0,0 +1,192 @@
+# ERPNext - web based ERP (http://erpnext.com)
+# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+
+from __future__ import unicode_literals
+import unittest
+import webnotes
+import webnotes.model
+from webnotes.utils import nowdate
+from accounts.utils import get_fiscal_year
+
+company = webnotes.conn.get_default("company")
+abbr = webnotes.conn.get_value("Company", company, "abbr")
+
+def load_data():
+	insert_accounts()
+	
+	# create default warehouse
+	if not webnotes.conn.exists("Warehouse", "Default Warehouse"):
+		webnotes.insert({"doctype": "Warehouse", 
+			"warehouse_name": "Default Warehouse",
+			"warehouse_type": "Stores"})
+	
+	# create UOM: Nos.
+	if not webnotes.conn.exists("UOM", "Nos"):
+		webnotes.insert({"doctype": "UOM", "uom_name": "Nos"})
+	
+	from webnotes.tests import insert_test_data
+	# create item groups and items
+	insert_test_data("Item Group", 
+		sort_fn=lambda ig: (ig[0].get('parent_item_group'), ig[0].get('name')))
+	insert_test_data("Item")
+
+	# create supplier type
+	webnotes.insert({"doctype": "Supplier Type", "supplier_type": "Manufacturing"})
+	
+	# create supplier
+	webnotes.insert({"doctype": "Supplier", "supplier_name": "East Wind Inc.",
+		"supplier_type": "Manufacturing", "company": company})
+		
+	# create default cost center if not exists
+	if not webnotes.conn.exists("Cost Center", "Default Cost Center - %s" % abbr):
+		dl = webnotes.insert({"doctype": "Cost Center", "group_or_ledger": "Ledger",
+			"cost_center_name": "Default Cost Center", 
+			"parent_cost_center": "Root - %s" % abbr,
+			"company_name": company, "company_abbr": abbr})
+		
+	# create account heads for taxes
+	
+	webnotes.insert({"doctype": "Account", "account_name": "Shipping Charges",
+		"parent_account": "Stock Expenses - %s" % abbr, "company": company,
+		"group_or_ledger": "Ledger"})
+		
+	webnotes.insert({"doctype": "Account", "account_name": "Customs Duty",
+		"parent_account": "Stock Expenses - %s" % abbr, "company": company,
+		"group_or_ledger": "Ledger"})
+	webnotes.insert({"doctype": "Account", "account_name": "Tax Assets",
+		"parent_account": "Current Assets - %s" % abbr, "company": company,
+		"group_or_ledger": "Group"})
+	webnotes.insert({"doctype": "Account", "account_name": "VAT - Test",
+		"parent_account": "Tax Assets - %s" % abbr, "company": company,
+		"group_or_ledger": "Ledger"})
+		
+	# create BOM
+	webnotes.insert([
+		{"doctype": "BOM", "item": "Nebula 7", "quantity": 1,
+			"is_active": "Yes", "is_default": 1, "uom": "Nos"},
+		{"doctype": "BOM Operation", "operation_no": 1, "parentfield": "bom_operations",
+			"opn_description": "Development"}, 
+		{"doctype": "BOM Item", "item_code": "Android Jack D", "operation_no": 1, 
+			"qty": 5, "rate": 20, "amount": 100, "stock_uom": "Nos", 
+			"parentfield": "bom_materials"}
+	])
+
+
+base_purchase_receipt = [
+	{
+		"doctype": "Purchase Receipt", "supplier": "East Wind Inc.",
+		"naming_series": "PR", "posting_date": nowdate(), "posting_time": "12:05",
+		"company": company, "fiscal_year": webnotes.conn.get_default("fiscal_year"), 
+		"currency": webnotes.conn.get_default("currency"), "conversion_rate": 1
+	},
+	{
+		"doctype": "Purchase Receipt Item", 
+		"item_code": "Home Desktop 100",
+		"qty": 10, "received_qty": 10, "rejected_qty": 0, "purchase_rate": 50, 
+		"amount": 500, "warehouse": "Default Warehouse", "valuation_tax_amount": 250,
+		"parentfield": "purchase_receipt_details",
+		"conversion_factor": 1, "uom": "Nos", "stock_uom": "Nos"
+	},
+	{
+		"doctype": "Purchase Taxes and Charges", "charge_type": "Actual",
+		"account_head": "Shipping Charges - %s" % abbr, "purchase_rate": 100, "tax_amount": 100,
+		"category": "Valuation and Total", "parentfield": "purchase_tax_details",
+		"cost_center": "Default Cost Center - %s" % abbr
+	}, 
+	{
+		"doctype": "Purchase Taxes and Charges", "charge_type": "Actual",
+		"account_head": "VAT - Test - %s" % abbr, "purchase_rate": 120, "tax_amount": 120,
+		"category": "Total", "parentfield": "purchase_tax_details"
+	},
+	{
+		"doctype": "Purchase Taxes and Charges", "charge_type": "Actual",
+		"account_head": "Customs Duty - %s" % abbr, "purchase_rate": 150, "tax_amount": 150,
+		"category": "Valuation", "parentfield": "purchase_tax_details",
+		"cost_center": "Default Cost Center - %s" % abbr
+	}
+]
+
+def insert_accounts():
+	for d in webnotes.conn.sql("""select name, abbr from tabCompany""", as_dict=1):
+		acc_list = [
+			make_account_dict('Stock Assets', 'Current Assets', d, 'Group'),
+				make_account_dict('Stock In Hand', 'Stock Assets', d, 'Ledger'),
+				make_account_dict('Stock Delivered But Not Billed', 'Stock Assets', 
+					d, 'Ledger'),
+			make_account_dict('Stock Liabilities', 'Current Liabilities', d, 'Group'),
+				make_account_dict('Stock Received But Not Billed', 'Stock Liabilities',
+				 	d, 'Ledger'),
+			make_account_dict('Stock Expenses', 'Direct Expenses', d, 'Group'),
+				make_account_dict('Stock Variance', 'Stock Expenses', d, 'Ledger'),
+				make_account_dict('Expenses Included In Valuation', 'Stock Expenses', 
+					d, 'Ledger'),
+		]
+		for acc in acc_list:
+			acc_name = "%s - %s" % (acc['account_name'], d['abbr'])
+			if not webnotes.conn.exists('Account', acc_name):
+				webnotes.insert(acc)
+			else:
+				print "Account %s already exists" % acc_name
+						
+def make_account_dict(account, parent, company_detail, group_or_ledger):
+	return {
+		"doctype": "Account",
+		"account_name": account,
+		"parent_account": "%s - %s" % (parent, company_detail['abbr']),
+		"company": company_detail['name'],
+		"group_or_ledger": group_or_ledger
+	}
+
+
+class TestPurchaseReceipt(unittest.TestCase):
+	def setUp(self):
+		webnotes.conn.begin()
+		load_data()
+		webnotes.conn.set_value("Global Defaults", None, "automatic_inventory_accounting", 1)
+		
+		
+	def test_purchase_receipt(self):
+		# warehouse does not have stock in hand specified
+		self.run_purchase_receipt_test(base_purchase_receipt,
+			"Stock In Hand - %s" % (abbr,), 
+			"Stock Received But Not Billed - %s" % (abbr,), 750.0)
+	
+	def run_purchase_receipt_test(self, purchase_receipt, debit_account, 
+			credit_account, stock_value):
+		from webnotes.model.doclist import DocList	
+		dl = webnotes.insert(DocList(purchase_receipt))
+		dl.submit()
+		dl.load_from_db()
+						
+		gle = webnotes.conn.sql("""select account, ifnull(debit, 0), ifnull(credit, 0)
+			from `tabGL Entry` where voucher_no = %s""", dl.doclist[0].name)
+		
+		gle_map = dict(((entry[0], entry) for entry in gle))
+		
+		self.assertEquals(gle_map[debit_account], (debit_account, stock_value, 0.0))
+		self.assertEquals(gle_map[credit_account], (credit_account, 0.0, stock_value))
+		
+	def atest_subcontracting(self):
+		pr = base_purchase_receipt.copy()
+		pr[1].update({"item_code": "Nebula 7"})
+		
+		self.run_purchase_receipt_test(pr, 
+			"Stock In Hand - %s" % (abbr,), 
+			"Stock Received But Not Billed - %s" % (abbr,), 1750.0)
+		
+	def tearDown(self):
+		webnotes.conn.rollback()
\ No newline at end of file
diff --git a/tests/data/item/android_jack_d.txt b/tests/data/item/android_jack_d.txt
new file mode 100644
index 0000000..24944e3
--- /dev/null
+++ b/tests/data/item/android_jack_d.txt
@@ -0,0 +1,37 @@
+# Item, Android Jack D
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-26 11:30:44',
+		u'docstatus': 0,
+		u'modified': '2012-08-26 11:30:44',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item
+	{
+		'description': u'Android Jack D',
+		'doctype': 'Item',
+		'has_batch_no': u'No',
+		'has_serial_no': u'No',
+		'inspection_required': u'No',
+		'is_purchase_item': u'Yes',
+		'is_sales_item': u'Yes',
+		'is_service_item': u'No',
+		'is_stock_item': u'Yes',
+		'item_code': u'Android Jack D',
+		'item_group': u'Android',
+		'item_name': u'Android Jack D',
+		u'name': u'__common__',
+		'stock_uom': u'Nos',
+		'default_warehouse': u'Default Warehouse'
+	},
+
+	# Item, Android Jack D
+	{
+		u'doctype': 'Item',
+		'name': u'Android Jack D'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item/android_jack_s.txt b/tests/data/item/android_jack_s.txt
new file mode 100644
index 0000000..feaceef
--- /dev/null
+++ b/tests/data/item/android_jack_s.txt
@@ -0,0 +1,37 @@
+# Item, Android Jack S
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-26 11:29:22',
+		u'docstatus': 0,
+		u'modified': '2012-08-26 11:29:22',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item
+	{
+		'description': u'Android Jack S',
+		'doctype': 'Item',
+		'has_batch_no': u'No',
+		'has_serial_no': u'No',
+		'inspection_required': u'No',
+		'is_purchase_item': u'Yes',
+		'is_sales_item': u'Yes',
+		'is_service_item': u'No',
+		'is_stock_item': u'Yes',
+		'item_code': u'Android Jack S',
+		'item_group': u'Android',
+		'item_name': u'Android Jack S',
+		u'name': u'__common__',
+		'stock_uom': u'Nos',
+		'default_warehouse': u'Default Warehouse'
+	},
+
+	# Item, Android Jack S
+	{
+		u'doctype': 'Item',
+		'name': u'Android Jack S'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item/home_desktop_100.txt b/tests/data/item/home_desktop_100.txt
new file mode 100644
index 0000000..19ef01d
--- /dev/null
+++ b/tests/data/item/home_desktop_100.txt
@@ -0,0 +1,37 @@
+# Item, Home Desktop 100
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-26 11:25:28',
+		u'docstatus': 0,
+		u'modified': '2012-08-26 11:25:28',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item
+	{
+		'description': u'Home Desktop 100',
+		'doctype': 'Item',
+		'has_batch_no': u'No',
+		'has_serial_no': u'No',
+		'inspection_required': u'No',
+		'is_purchase_item': u'Yes',
+		'is_sales_item': u'Yes',
+		'is_service_item': u'No',
+		'is_stock_item': u'Yes',
+		'item_code': u'Home Desktop 100',
+		'item_group': u'Home Series',
+		'item_name': u'Home Desktop 100',
+		u'name': u'__common__',
+		'stock_uom': u'Nos',
+		'default_warehouse': u'Default Warehouse'
+	},
+
+	# Item, Home Desktop 100
+	{
+		u'doctype': 'Item',
+		'name': u'Home Desktop 100'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item/home_desktop_200.txt b/tests/data/item/home_desktop_200.txt
new file mode 100644
index 0000000..053e37c
--- /dev/null
+++ b/tests/data/item/home_desktop_200.txt
@@ -0,0 +1,37 @@
+# Item, Home Desktop 200
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-26 11:25:54',
+		u'docstatus': 0,
+		u'modified': '2012-08-26 11:25:54',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item
+	{
+		'description': u'Home Desktop 200',
+		'doctype': 'Item',
+		'has_batch_no': u'No',
+		'has_serial_no': u'No',
+		'inspection_required': u'No',
+		'is_purchase_item': u'Yes',
+		'is_sales_item': u'Yes',
+		'is_service_item': u'No',
+		'is_stock_item': u'Yes',
+		'item_code': u'Home Desktop 200',
+		'item_group': u'Home Series',
+		'item_name': u'Home Desktop 200',
+		u'name': u'__common__',
+		'stock_uom': u'Nos',
+		'default_warehouse': u'Default Warehouse'
+	},
+
+	# Item, Home Desktop 200
+	{
+		u'doctype': 'Item',
+		'name': u'Home Desktop 200'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item/home_desktop_300.txt b/tests/data/item/home_desktop_300.txt
new file mode 100644
index 0000000..304b2ef
--- /dev/null
+++ b/tests/data/item/home_desktop_300.txt
@@ -0,0 +1,37 @@
+# Item, Home Desktop 300
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-26 11:26:37',
+		u'docstatus': 0,
+		u'modified': '2012-08-26 11:26:37',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item
+	{
+		'description': u'Home Desktop 300',
+		'doctype': 'Item',
+		'has_batch_no': u'No',
+		'has_serial_no': u'No',
+		'inspection_required': u'No',
+		'is_purchase_item': u'Yes',
+		'is_sales_item': u'Yes',
+		'is_service_item': u'No',
+		'is_stock_item': u'Yes',
+		'item_code': u'Home Desktop 300',
+		'item_group': u'Home Series',
+		'item_name': u'Home Desktop 300',
+		u'name': u'__common__',
+		'stock_uom': u'Nos',
+		'default_warehouse': u'Default Warehouse'
+	},
+
+	# Item, Home Desktop 300
+	{
+		u'doctype': 'Item',
+		'name': u'Home Desktop 300'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item/nebula_7.txt b/tests/data/item/nebula_7.txt
new file mode 100644
index 0000000..9f61d7a
--- /dev/null
+++ b/tests/data/item/nebula_7.txt
@@ -0,0 +1,38 @@
+# Item, Nebula 7
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-26 11:32:02',
+		u'docstatus': 0,
+		u'modified': '2012-08-26 11:32:02',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item
+	{
+		'description': u'Nebula 7',
+		'doctype': 'Item',
+		'has_batch_no': u'No',
+		'has_serial_no': u'No',
+		'inspection_required': u'No',
+		'is_sub_contracted_item': 'Yes',
+		'is_purchase_item': u'No',
+		'is_sales_item': u'Yes',
+		'is_service_item': u'No',
+		'is_stock_item': u'Yes',
+		'item_code': u'Nebula 7',
+		'item_group': u'Small Tablets',
+		'item_name': u'Nebula 7',
+		u'name': u'__common__',
+		'stock_uom': u'Nos',
+		'default_warehouse': u'Default Warehouse'
+	},
+
+	# Item, Nebula 7
+	{
+		u'doctype': 'Item',
+		'name': u'Nebula 7'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/accessories.txt b/tests/data/item_group/accessories.txt
new file mode 100644
index 0000000..c4d3b1a
--- /dev/null
+++ b/tests/data/item_group/accessories.txt
@@ -0,0 +1,27 @@
+# Item Group, Accessories
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:55:59',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:55:59',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'Yes',
+		'item_group_name': u'Accessories',
+		u'name': u'__common__',
+		'parent_item_group': u'All Item Groups'
+	},
+
+	# Item Group, Accessories
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Accessories'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/android.txt b/tests/data/item_group/android.txt
new file mode 100644
index 0000000..9d66be5
--- /dev/null
+++ b/tests/data/item_group/android.txt
@@ -0,0 +1,27 @@
+# Item Group, Android
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:57:11',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:57:11',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Android',
+		u'name': u'__common__',
+		'parent_item_group': u'Smartphones'
+	},
+
+	# Item Group, Android
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Android'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/desktops.txt b/tests/data/item_group/desktops.txt
new file mode 100644
index 0000000..7c093d5
--- /dev/null
+++ b/tests/data/item_group/desktops.txt
@@ -0,0 +1,27 @@
+# Item Group, Desktops
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:55:28',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:55:28',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'Yes',
+		'item_group_name': u'Desktops',
+		u'name': u'__common__',
+		'parent_item_group': u'All Item Groups'
+	},
+
+	# Item Group, Desktops
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Desktops'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/full_size_tablets.txt b/tests/data/item_group/full_size_tablets.txt
new file mode 100644
index 0000000..158547c
--- /dev/null
+++ b/tests/data/item_group/full_size_tablets.txt
@@ -0,0 +1,27 @@
+# Item Group, Full Size Tablets
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:58:20',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:58:20',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Full Size Tablets',
+		u'name': u'__common__',
+		'parent_item_group': u'Tablets'
+	},
+
+	# Item Group, Full Size Tablets
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Full Size Tablets'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/gamer.txt b/tests/data/item_group/gamer.txt
new file mode 100644
index 0000000..bce38c7
--- /dev/null
+++ b/tests/data/item_group/gamer.txt
@@ -0,0 +1,27 @@
+# Item Group, Gamer
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:56:27',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:56:27',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Gamer',
+		u'name': u'__common__',
+		'parent_item_group': u'Desktops'
+	},
+
+	# Item Group, Gamer
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Gamer'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/home_series.txt b/tests/data/item_group/home_series.txt
new file mode 100644
index 0000000..27eeec3
--- /dev/null
+++ b/tests/data/item_group/home_series.txt
@@ -0,0 +1,27 @@
+# Item Group, Home Series
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:56:15',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:56:15',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Home Series',
+		u'name': u'__common__',
+		'parent_item_group': u'Desktops'
+	},
+
+	# Item Group, Home Series
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Home Series'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/laptops.txt b/tests/data/item_group/laptops.txt
new file mode 100644
index 0000000..2ac14d1
--- /dev/null
+++ b/tests/data/item_group/laptops.txt
@@ -0,0 +1,27 @@
+# Item Group, Laptops
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:55:36',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:55:36',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'Yes',
+		'item_group_name': u'Laptops',
+		u'name': u'__common__',
+		'parent_item_group': u'All Item Groups'
+	},
+
+	# Item Group, Laptops
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Laptops'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/lightweight.txt b/tests/data/item_group/lightweight.txt
new file mode 100644
index 0000000..b3e01e5
--- /dev/null
+++ b/tests/data/item_group/lightweight.txt
@@ -0,0 +1,27 @@
+# Item Group, Lightweight
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:56:57',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:56:58',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Lightweight',
+		u'name': u'__common__',
+		'parent_item_group': u'Laptops'
+	},
+
+	# Item Group, Lightweight
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Lightweight'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/medium_tablets.txt b/tests/data/item_group/medium_tablets.txt
new file mode 100644
index 0000000..87bda5d
--- /dev/null
+++ b/tests/data/item_group/medium_tablets.txt
@@ -0,0 +1,27 @@
+# Item Group, Medium Tablets
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:57:51',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:57:51',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Medium Tablets',
+		u'name': u'__common__',
+		'parent_item_group': u'Tablets'
+	},
+
+	# Item Group, Medium Tablets
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Medium Tablets'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/pro_series.txt b/tests/data/item_group/pro_series.txt
new file mode 100644
index 0000000..e66f91a
--- /dev/null
+++ b/tests/data/item_group/pro_series.txt
@@ -0,0 +1,27 @@
+# Item Group, Pro Series
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:56:20',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:56:20',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Pro Series',
+		u'name': u'__common__',
+		'parent_item_group': u'Desktops'
+	},
+
+	# Item Group, Pro Series
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Pro Series'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/small_tablets.txt b/tests/data/item_group/small_tablets.txt
new file mode 100644
index 0000000..cbf4399
--- /dev/null
+++ b/tests/data/item_group/small_tablets.txt
@@ -0,0 +1,27 @@
+# Item Group, Small Tablets
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:57:44',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:57:44',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Small Tablets',
+		u'name': u'__common__',
+		'parent_item_group': u'Tablets'
+	},
+
+	# Item Group, Small Tablets
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Small Tablets'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/smartphones.txt b/tests/data/item_group/smartphones.txt
new file mode 100644
index 0000000..ee7dfb9
--- /dev/null
+++ b/tests/data/item_group/smartphones.txt
@@ -0,0 +1,27 @@
+# Item Group, Smartphones
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:55:49',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:55:49',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'Yes',
+		'item_group_name': u'Smartphones',
+		u'name': u'__common__',
+		'parent_item_group': u'All Item Groups'
+	},
+
+	# Item Group, Smartphones
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Smartphones'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/tablets.txt b/tests/data/item_group/tablets.txt
new file mode 100644
index 0000000..cc44bae
--- /dev/null
+++ b/tests/data/item_group/tablets.txt
@@ -0,0 +1,27 @@
+# Item Group, Tablets
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:55:42',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:55:42',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'Yes',
+		'item_group_name': u'Tablets',
+		u'name': u'__common__',
+		'parent_item_group': u'All Item Groups'
+	},
+
+	# Item Group, Tablets
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Tablets'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/tough.txt b/tests/data/item_group/tough.txt
new file mode 100644
index 0000000..0d3badd
--- /dev/null
+++ b/tests/data/item_group/tough.txt
@@ -0,0 +1,27 @@
+# Item Group, Tough
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:56:41',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:56:41',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Tough',
+		u'name': u'__common__',
+		'parent_item_group': u'Laptops'
+	},
+
+	# Item Group, Tough
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Tough'
+	}
+]
\ No newline at end of file
diff --git a/tests/data/item_group/ultrabook.txt b/tests/data/item_group/ultrabook.txt
new file mode 100644
index 0000000..4bb19d7
--- /dev/null
+++ b/tests/data/item_group/ultrabook.txt
@@ -0,0 +1,27 @@
+# Item Group, Ultrabook
+[
+
+	# These values are common in all dictionaries
+	{
+		u'creation': '2012-08-07 09:56:50',
+		u'docstatus': 0,
+		u'modified': '2012-08-07 09:56:50',
+		u'modified_by': u'Administrator',
+		u'owner': u'Administrator'
+	},
+
+	# These values are common for all Item Group
+	{
+		u'doctype': 'Item Group',
+		'is_group': u'No',
+		'item_group_name': u'Ultrabook',
+		u'name': u'__common__',
+		'parent_item_group': u'Laptops'
+	},
+
+	# Item Group, Ultrabook
+	{
+		u'doctype': 'Item Group',
+		u'name': u'Ultrabook'
+	}
+]
\ No newline at end of file