RestApiv2/internal/bd/filmrepo_test.go

23 lines
490 B
Go

package bd_test
import (
"testing"
"git.ukamnya.ru/stulyaganov/RestApi/internal/bd"
"git.ukamnya.ru/stulyaganov/RestApi/internal/bd/model"
"github.com/stretchr/testify/assert"
)
func TestFilmRepo_Create(t *testing.T) {
s, teardown := bd.Testdb(t, "host=localhost user=admin password=root dbname=postgres sslmode=disable")
defer teardown("films")
u, err := s.Films().Create(&model.Films{
Id: 0,
Ru_title: "sdasdasda",
})
assert.NoError(t, err)
assert.NotNil(t, u)
}