Chore: Remove CreateUserForTests() (#64125)

* Chore: Remove CreateUserForTests

* Apply suggestion from code review
This commit is contained in:
Sofia Papagiannaki
2023-03-03 18:01:23 +02:00
committed by GitHub
parent a52999a886
commit e6e8351ee9
27 changed files with 235 additions and 296 deletions

View File

@ -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,
}
dataSource, err := testEnv.Server.HTTPServer.DataSourcesService.GetDataSource(ctx, getDataSourceQuery)