22 lines
481 B
Go
22 lines
481 B
Go
package bd_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.ukamnya.ru/stulyaganov/RestApiv2/internal/bd"
|
|
"git.ukamnya.ru/stulyaganov/RestApiv2/internal/bd/model"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFilmRepo_Create(t *testing.T) {
|
|
|
|
s, teardown := bd.Testdb(t, "host=localhost user=test password=test dbname=test sslmode=disable")
|
|
defer teardown("films")
|
|
u, err := s.Films().Create(&model.Films{
|
|
Id: 11,
|
|
Ru_title: nil,
|
|
})
|
|
assert.NoError(t, err)
|
|
assert.NotNil(t, u)
|
|
}
|