[v9.4.x] Chore: Remove CreateUserForTests() (#64125) (#64165)

Chore: Remove CreateUserForTests() (#64125)

* Chore: Remove CreateUserForTests

* Apply suggestion from code review

(cherry picked from commit e6e8351ee9)
This commit is contained in:
Sofia Papagiannaki
2023-03-03 18:43:10 +02:00
committed by GitHub
parent 5014df0521
commit 8c12f75b0b
27 changed files with 236 additions and 297 deletions
@@ -262,7 +262,7 @@ func newTestScenario(t *testing.T, name string, opts []testScenarioOption, callb
tsCtx.testEnv = testEnv
ctx := context.Background()
testinfra.CreateUser(t, testEnv.SQLStore, user.CreateUserCommand{
u := testinfra.CreateUser(t, testEnv.SQLStore, user.CreateUserCommand{
DefaultOrgRole: string(org.RoleAdmin),
Password: "admin",
Login: "admin",
@@ -284,7 +284,7 @@ func newTestScenario(t *testing.T, name string, opts []testScenarioOption, callb
tsCtx.uid = "test-plugin"
cmd := &datasources.AddDataSourceCommand{
OrgId: 1,
OrgId: u.OrgID,
Access: datasources.DS_ACCESS_PROXY,
Name: "TestPlugin",
Type: tsCtx.testPluginID,
@@ -306,7 +306,7 @@ func newTestScenario(t *testing.T, name string, opts []testScenarioOption, callb
require.NoError(t, err)
getDataSourceQuery := &datasources.GetDataSourceQuery{
OrgId: 1,
OrgId: u.OrgID,
Uid: tsCtx.uid,
}
err = testEnv.Server.HTTPServer.DataSourcesService.GetDataSource(ctx, getDataSourceQuery)