func TestUserDatabase(t *testing.T) {
	DB = new(SqliteBackend)
	DB.DSN("~/.config/wavepipe/wavepipe.db")
	if err := DB.Open(); err != nil {
		t.Fatalf("Could not open database connection: %s", err.Error())
	}
	defer DB.Close()
	user, err := NewUser("TestUser", "TestPassword", RoleGuest)
	if err != nil {
		t.Fatalf("Could not create and save user: %s", err.Error())
	}
	if err := user.Load(); err != nil {
		t.Fatalf("Could not load user: %s", err.Error())
	}
	user.LastFMToken = "hello"
	if err := user.Update(); err != nil {
		t.Fatalf("Could not update user: %s", err.Error())
	}
	if err := user.Delete(); err != nil {
		t.Fatalf("Could not delete user: %s", err.Error())
	}
}
TestUserDatabase verifies that an User can be saved and loaded from the database
package data
import (
	"testing"
)