Add tests for plain text time

This commit is contained in:
Jinzhu 2013-10-30 08:57:48 +08:00
parent db7fc2d53a
commit 9aacae473c
1 changed files with 6 additions and 0 deletions

View File

@ -237,6 +237,12 @@ func TestComplexWhere(t *testing.T) {
t.Errorf("Should only found 3 users's birthday >= t2", len(users))
}
users = []User{}
db.Where("birthday > ?", "2002-10-10").Find(&users)
if len(users) != 3 {
t.Errorf("Should only found 3 users's birthday >= t2", len(users))
}
users = []User{}
db.Where("birthday >= ?", t1).Where("birthday < ?", t2).Find(&users)
if len(users) != 1 {