From e91d4f106b1f97abb06f3af9506f00a730357f9e Mon Sep 17 00:00:00 2001 From: Nanguan Lin <70063547+lng2020@users.noreply.github.com> Date: Thu, 19 Oct 2023 18:25:57 +0800 Subject: Upgrade xorm (#27673) Related to https://gitea.com/xorm/xorm/pulls/2341 --- models/unittest/unit_tests.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'models/unittest') diff --git a/models/unittest/unit_tests.go b/models/unittest/unit_tests.go index 399040580c..d47bceea1e 100644 --- a/models/unittest/unit_tests.go +++ b/models/unittest/unit_tests.go @@ -96,7 +96,15 @@ func AssertExistsAndLoadMap(t assert.TestingT, table string, conditions ...any) // GetCount get the count of a bean func GetCount(t assert.TestingT, bean any, conditions ...any) int { e := db.GetEngine(db.DefaultContext) - count, err := whereOrderConditions(e, conditions).Count(bean) + for _, condition := range conditions { + switch cond := condition.(type) { + case *testCond: + e = e.Where(cond.query, cond.args...) + default: + e = e.Where(cond) + } + } + count, err := e.Count(bean) assert.NoError(t, err) return int(count) } -- cgit v1.2.3