func (this *TemplatesDetailController) LoadCustomTemplateDetail() {
	id, err := this.GetInt64("id", 0)
	template := entity.Template{}
	if err == nil {
		template.Id = id
		err = template.Load()
		if err == nil {
			this.Data["json"] = &template
			this.ServeJSON()
		}
	}
}
var _ = Describe("Testing Template CRUD", func() {
	It("Template Save", func() {
		var template entity.Template = entity.Template{Name: "template", Description: "description"}
		err := template.Save()
		Expect(err).ToNot(HaveOccurred())

		err = template.Delete()
		Expect(err).ToNot(HaveOccurred())
	})
	It("Template Update", func() {
		template := entity.Template{Name: "template mysql-service", Description: "provide mysql store service"}
		id, err := orm.NewOrm().Insert(&template)
		Expect(err).ToNot(HaveOccurred())
		template1 := entity.Template{}
		template1.Id = id
		errs := template1.Load()
		Expect(errs).ToNot(HaveOccurred())
		template1.Name = "New-template-mysql-service"
		errs = template1.Update()
		Expect(errs).ToNot(HaveOccurred())
		errs = template1.Load()
		Expect(errs).ToNot(HaveOccurred())

		Expect(template1.Name).To(Equal("New-template-mysql-service"))

		errs = template1.Delete()
		Expect(errs).ToNot(HaveOccurred())

	})
})