示例#1
0
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)
}
示例#2
0
// Creates a test appengine context object
func UseTestAppEngineContext() {

	AppEngineContext, _ = appenginetesting.NewContext(nil)

}