mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 18:13:32 -06:00
* chore: add alias for InitTestDB and Session Adds an alias for the sqlstore InitTestDB and Session, and updates tests using these to reduce dependencies on the sqlstore.Store. * next pass of removing sqlstore imports * last little bit * remove mockstore where possible
32 lines
605 B
Go
32 lines
605 B
Go
package userauthimpl
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/grafana/grafana/pkg/infra/db"
|
|
)
|
|
|
|
func TestIntegrationUserAuthDataAccess(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("skipping integration test")
|
|
}
|
|
|
|
ss := db.InitTestDB(t)
|
|
userAuthStore := sqlStore{
|
|
db: ss,
|
|
}
|
|
|
|
t.Run("delete user auth", func(t *testing.T) {
|
|
err := userAuthStore.Delete(context.Background(), 1)
|
|
require.NoError(t, err)
|
|
})
|
|
|
|
t.Run("delete user auth token", func(t *testing.T) {
|
|
err := userAuthStore.DeleteToken(context.Background(), 1)
|
|
require.NoError(t, err)
|
|
})
|
|
}
|