grafana/pkg/services/userauth/userauthimpl/store_test.go
Kristin Laemmert 05709ce411
chore: remove sqlstore & mockstore dependencies from (most) packages (#57087)
* 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
2022-10-19 09:02:15 -04:00

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)
})
}