# Copyright (c) 2015, InfluxFramework LLC
# License: GNU General Public License v3. See license.txt

import influxframework

# test_records = influxframework.get_test_records('Designation')


def create_designation(**args):
	args = influxframework._dict(args)
	if influxframework.db.exists("Designation", args.designation_name or "_Test designation"):
		return influxframework.get_doc("Designation", args.designation_name or "_Test designation")

	designation = influxframework.get_doc(
		{
			"doctype": "Designation",
			"designation_name": args.designation_name or "_Test designation",
			"description": args.description or "_Test description",
		}
	)
	designation.save()
	return designation
