func newContext(r *http.Request) appengine.Context { if appengine.IsDevAppServer() && r.Header.Get("App-Testing") != "" { if context == nil { var err error if context, err = appenginetesting.NewContext(nil); err != nil { panic(err) } } return context } return appengine.NewContext(r) }
// Creates a test appengine context object func UseTestAppEngineContext() { AppEngineContext, _ = appenginetesting.NewContext(nil) }