func TestCommandStoreSave(t *testing.T) { Setup() o1 := model.Command{} o1.CreatorId = model.NewId() o1.Method = model.COMMAND_METHOD_POST o1.TeamId = model.NewId() o1.URL = "http://nowhere.com/" if err := (<-store.Command().Save(&o1)).Err; err != nil { t.Fatal("couldn't save item", err) } if err := (<-store.Command().Save(&o1)).Err; err == nil { t.Fatal("shouldn't be able to update from save") } }