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
@@ -2743,6 +2743,9 @@ func rulesNamespaceWithoutVariableValues(t *testing.T, b []byte) (string, map[st
func createUser(t *testing.T, store *sqlstore.SQLStore, cmd models.CreateUserCommand) int64 {
t.Helper()
store.Cfg.AutoAssignOrg = true
store.Cfg.AutoAssignOrgId = 1
u, err := store.CreateUser(context.Background(), cmd)
require.NoError(t, err)
return u.Id