Format time first when testing

This commit is contained in:
Jinzhu 2015-12-25 11:24:21 +08:00
parent 4a821a5bef
commit f8c3ad6af3
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ func TestCreate(t *testing.T) {
DB.Model(user).Update("name", "create_user_new_name")
DB.First(&user, user.Id)
if user.CreatedAt != newUser.CreatedAt {
if user.CreatedAt.Format(time.RFC3339Nano) != newUser.CreatedAt.Format(time.RFC3339Nano) {
t.Errorf("CreatedAt should not be changed after update")
}
}