2022-12-13 19:24:42 +03:00
|
|
|
package bd_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2023-03-31 20:08:38 +03:00
|
|
|
"git.ukamnya.ru/stulyaganov/RestApiv2/internal/bd"
|
|
|
|
"git.ukamnya.ru/stulyaganov/RestApiv2/internal/bd/model"
|
2022-12-13 19:24:42 +03:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestFilmRepo_Create(t *testing.T) {
|
|
|
|
|
2023-01-03 19:27:10 +03:00
|
|
|
s, teardown := bd.Testdb(t, "host=localhost user=test password=test dbname=test sslmode=disable")
|
2022-12-13 19:24:42 +03:00
|
|
|
defer teardown("films")
|
|
|
|
u, err := s.Films().Create(&model.Films{
|
2022-12-31 01:43:30 +03:00
|
|
|
Id: 11,
|
2023-03-15 22:44:31 +03:00
|
|
|
Ru_title: nil,
|
2022-12-13 19:24:42 +03:00
|
|
|
})
|
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.NotNil(t, u)
|
|
|
|
}
|