1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-15 02:00:54 +00:00

skip strictexact operator test for db drivers other than mysql

This commit is contained in:
CadenGuo 2020-08-31 15:29:48 +00:00
parent 60bb057783
commit ff53e12191
No known key found for this signature in database
GPG Key ID: 047A2EAA8F2CFF93

View File

@ -822,13 +822,16 @@ func TestOperators(t *testing.T) {
throwFail(t, err) throwFail(t, err)
throwFail(t, AssertIs(num, 1)) throwFail(t, AssertIs(num, 1))
num, err = qs.Filter("user_name__strictexact", "Slene").Count() if dORM.Driver().Name() == "mysql" {
throwFail(t, err) // Now only mysql support `strictexact`
throwFail(t, AssertIs(num, 0)) num, err = qs.Filter("user_name__strictexact", "Slene").Count()
throwFail(t, err)
throwFail(t, AssertIs(num, 0))
num, err = qs.Filter("user_name__strictexact", "slene").Count() num, err = qs.Filter("user_name__strictexact", "slene").Count()
throwFail(t, err) throwFail(t, err)
throwFail(t, AssertIs(num, 1)) throwFail(t, AssertIs(num, 1))
}
num, err = qs.Filter("user_name__contains", "e").Count() num, err = qs.Filter("user_name__contains", "e").Count()
throwFail(t, err) throwFail(t, err)