RestApiv2/internal/bd/filmrepo_test.go

22 lines
481 B
Go
Raw Permalink Normal View History

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) {
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)
}