优化
This commit is contained in:
@@ -30,7 +30,7 @@ func TestUserAuthorityWritesAreAtomic(t *testing.T) {
|
||||
if err := data.gormDB.WithContext(ctx).Create(&[]authorityPO{{AuthorityID: 888, AuthorityName: "admin"}, {AuthorityID: 999, AuthorityName: "operator"}}).Error; err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
repo := &systemRepo{data: data}
|
||||
repo := &userRepo{data: data}
|
||||
user := &biz.User{Username: "atomic", Password: "hash", NickName: "before", AuthorityID: 888, Enable: 1}
|
||||
created, err := repo.CreateUserWithAuthorities(ctx, user, []uint{888, 999})
|
||||
if err != nil {
|
||||
@@ -66,7 +66,7 @@ func TestUserAuthorityWritesAreAtomic(t *testing.T) {
|
||||
func TestDictionaryImportKeepsHierarchyInOneTransaction(t *testing.T) {
|
||||
data := newTransactionTestData(t)
|
||||
ctx := context.Background()
|
||||
repo := &settingsRepo{data: data}
|
||||
repo := &dictionaryRepo{data: data}
|
||||
parentID := uint(10)
|
||||
dictionary := &biz.Dictionary{Name: "status", Type: "status", Status: true}
|
||||
details := []*biz.DictionaryDetail{{ID: 10, Label: "parent", Value: "1", Status: true}, {ID: 11, Label: "child", Value: "2", ParentID: &parentID, Status: true}}
|
||||
|
||||
Reference in New Issue
Block a user