1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 12:10:55 +00:00

update the test case

This commit is contained in:
astaxie 2014-11-04 22:07:38 +08:00
parent 15242d89ce
commit 000033e2a7
2 changed files with 9 additions and 3 deletions

View File

@ -29,7 +29,10 @@ func TestCookie(t *testing.T) {
}
r, _ := http.NewRequest("GET", "/", nil)
w := httptest.NewRecorder()
sess := globalSessions.SessionStart(w, r)
sess, err := globalSessions.SessionStart(w, r)
if err != nil {
t.Fatal("set error,", err)
}
err = sess.Set("username", "astaxie")
if err != nil {
t.Fatal("set error,", err)

View File

@ -26,9 +26,12 @@ func TestMem(t *testing.T) {
go globalSessions.GC()
r, _ := http.NewRequest("GET", "/", nil)
w := httptest.NewRecorder()
sess := globalSessions.SessionStart(w, r)
sess, err := globalSessions.SessionStart(w, r)
if err != nil {
t.Fatal("set error,", err)
}
defer sess.SessionRelease(w)
err := sess.Set("username", "astaxie")
err = sess.Set("username", "astaxie")
if err != nil {
t.Fatal("set error,", err)
}