diff options
author | 6543 <m.huber@kithara.com> | 2024-02-19 14:42:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 14:42:18 +0100 |
commit | 217d71c48a10265e08b95cc961656b921f61f9ff (patch) | |
tree | 511e26061246ae3dd395136591e3f8ea71fb62f8 /models/unittest | |
parent | 39a77d92d9677b0a0049cb8696960d6d2ac052d6 (diff) | |
download | gitea-217d71c48a10265e08b95cc961656b921f61f9ff.tar.gz gitea-217d71c48a10265e08b95cc961656b921f61f9ff.zip |
Workaround to clean up old reviews on creating a new one (#28554)
close #28542
blocks #28544
---
*Sponsored by Kithara Software GmbH*
Diffstat (limited to 'models/unittest')
-rw-r--r-- | models/unittest/unit_tests.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/unittest/unit_tests.go b/models/unittest/unit_tests.go index d47bceea1e..75898436fc 100644 --- a/models/unittest/unit_tests.go +++ b/models/unittest/unit_tests.go @@ -131,8 +131,8 @@ func AssertSuccessfulInsert(t assert.TestingT, beans ...any) { } // AssertCount assert the count of a bean -func AssertCount(t assert.TestingT, bean, expected any) { - assert.EqualValues(t, expected, GetCount(t, bean)) +func AssertCount(t assert.TestingT, bean, expected any) bool { + return assert.EqualValues(t, expected, GetCount(t, bean)) } // AssertInt64InRange assert value is in range [low, high] @@ -150,7 +150,7 @@ func GetCountByCond(t assert.TestingT, tableName string, cond builder.Cond) int6 } // AssertCountByCond test the count of database entries matching bean -func AssertCountByCond(t assert.TestingT, tableName string, cond builder.Cond, expected int) { - assert.EqualValues(t, expected, GetCountByCond(t, tableName, cond), +func AssertCountByCond(t assert.TestingT, tableName string, cond builder.Cond, expected int) bool { + return assert.EqualValues(t, expected, GetCountByCond(t, tableName, cond), "Failed consistency test, the counted bean (of table %s) was %+v", tableName, cond) } |