mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 22:20:50 +00:00
update the test case
This commit is contained in:
parent
15242d89ce
commit
000033e2a7
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user