mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-22 13:18:29 -04:00
Unit tests and bug fix for models/org
This commit is contained in:
parent
bb5a6b7a07
commit
a2412492da
10 changed files with 671 additions and 26 deletions
|
@ -59,6 +59,13 @@ func loadBeanIfExists(bean interface{}, conditions ...interface{}) (bool, error)
|
|||
return sess.Get(bean)
|
||||
}
|
||||
|
||||
// BeanExists for testing, check if a bean exists
|
||||
func BeanExists(t *testing.T, bean interface{}, conditions ...interface{}) bool {
|
||||
exists, err := loadBeanIfExists(bean, conditions...)
|
||||
assert.NoError(t, err)
|
||||
return exists
|
||||
}
|
||||
|
||||
// AssertExistsAndLoadBean assert that a bean exists and load it from the test
|
||||
// database
|
||||
func AssertExistsAndLoadBean(t *testing.T, bean interface{}, conditions ...interface{}) interface{} {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue