clean up duplicated user creation code (#50178)

* clean up duplicated user creation code

* remove unused duplicate getOrCreateOrg function

* fix up tests
This commit is contained in:
Dan Cech
2022-06-07 09:49:18 -04:00
committed by GitHub
parent 32a8af59d6
commit 9350ab781c
12 changed files with 46 additions and 213 deletions

View File

@@ -36,10 +36,10 @@ func TestServiceAccountsAPI_CreateServiceAccount(t *testing.T) {
store := sqlstore.InitTestDB(t)
svcmock := tests.ServiceAccountMock{}
autoAssignOrg := setting.AutoAssignOrg
setting.AutoAssignOrg = true
autoAssignOrg := store.Cfg.AutoAssignOrg
store.Cfg.AutoAssignOrg = true
defer func() {
setting.AutoAssignOrg = autoAssignOrg
store.Cfg.AutoAssignOrg = autoAssignOrg
}()
orgCmd := &models.CreateOrgCommand{Name: "Some Test Org"}