mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 06:52:13 +08:00
merge create user handlers
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package sqlstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -22,9 +23,9 @@ func TestAccountDataAccess(t *testing.T) {
|
||||
ac1cmd := m.CreateUserCommand{Login: "ac1", Email: "ac1@test.com", Name: "ac1 name"}
|
||||
ac2cmd := m.CreateUserCommand{Login: "ac2", Email: "ac2@test.com", Name: "ac2 name"}
|
||||
|
||||
err := CreateUser(&ac1cmd)
|
||||
err := CreateUser(context.Background(), &ac1cmd)
|
||||
So(err, ShouldBeNil)
|
||||
err = CreateUser(&ac2cmd)
|
||||
err = CreateUser(context.Background(), &ac2cmd)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
q1 := m.GetUserOrgListQuery{UserId: ac1cmd.Result.Id}
|
||||
@ -43,8 +44,8 @@ func TestAccountDataAccess(t *testing.T) {
|
||||
ac1cmd := m.CreateUserCommand{Login: "ac1", Email: "ac1@test.com", Name: "ac1 name"}
|
||||
ac2cmd := m.CreateUserCommand{Login: "ac2", Email: "ac2@test.com", Name: "ac2 name", IsAdmin: true}
|
||||
|
||||
err := CreateUser(&ac1cmd)
|
||||
err = CreateUser(&ac2cmd)
|
||||
err := CreateUser(context.Background(), &ac1cmd)
|
||||
err = CreateUser(context.Background(), &ac2cmd)
|
||||
So(err, ShouldBeNil)
|
||||
|
||||
ac1 := ac1cmd.Result
|
||||
@ -182,7 +183,7 @@ func TestAccountDataAccess(t *testing.T) {
|
||||
|
||||
Convey("Given an org user with dashboard permissions", func() {
|
||||
ac3cmd := m.CreateUserCommand{Login: "ac3", Email: "ac3@test.com", Name: "ac3 name", IsAdmin: false}
|
||||
err := CreateUser(&ac3cmd)
|
||||
err := CreateUser(context.Background(), &ac3cmd)
|
||||
So(err, ShouldBeNil)
|
||||
ac3 := ac3cmd.Result
|
||||
|
||||
|
Reference in New Issue
Block a user