1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-15 04:50:55 +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,6 +822,8 @@ func TestOperators(t *testing.T) {
throwFail(t, err) throwFail(t, err)
throwFail(t, AssertIs(num, 1)) throwFail(t, AssertIs(num, 1))
if dORM.Driver().Name() == "mysql" {
// Now only mysql support `strictexact`
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, 0)) throwFail(t, AssertIs(num, 0))
@ -829,6 +831,7 @@ func TestOperators(t *testing.T) {
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)