mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 10:52:40 +08:00
Chore: Remove CreateUserForTests() (#64125)
* Chore: Remove CreateUserForTests * Apply suggestion from code review
This commit is contained in:

committed by
GitHub

parent
a52999a886
commit
e6e8351ee9
@ -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)
|
||||
|
Reference in New Issue
Block a user