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:
@@ -6,7 +6,6 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -74,10 +73,10 @@ func TestIntegrationUserDataAccess(t *testing.T) {
|
||||
t.Run("Testing DB - create user assigned to other organization", func(t *testing.T) {
|
||||
ss = InitTestDB(t)
|
||||
|
||||
autoAssignOrg := setting.AutoAssignOrg
|
||||
setting.AutoAssignOrg = true
|
||||
autoAssignOrg := ss.Cfg.AutoAssignOrg
|
||||
ss.Cfg.AutoAssignOrg = true
|
||||
defer func() {
|
||||
setting.AutoAssignOrg = autoAssignOrg
|
||||
ss.Cfg.AutoAssignOrg = autoAssignOrg
|
||||
}()
|
||||
|
||||
orgCmd := &models.CreateOrgCommand{Name: "Some Test Org"}
|
||||
|
||||
Reference in New Issue
Block a user