2022-12-13 19:24:42 +03:00
|
|
|
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{
|
2022-12-31 01:43:30 +03:00
|
|
|
Id: 11,
|
|
|
|
Ru_title: "fasfa",
|
2022-12-13 19:24:42 +03:00
|
|
|
})
|
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.NotNil(t, u)
|
|
|
|
}
|