Use MustTx

This commit is contained in:
Aaron L 2016-07-14 23:15:35 -07:00
parent c57b3ea3b7
commit e6b8cfff93
2 changed files with 3 additions and 8 deletions

View file

@ -5,10 +5,8 @@
{{- range toManyRelationships .Table.Name .Tables -}}
{{- $rel := textsFromRelationship $dot.Tables $table . -}}
func Test{{$rel.LocalTable.NameGo}}ToMany{{$rel.Function.Name}}(t *testing.T) {
tx, err := boil.Begin()
if err != nil {
t.Fatal(err)
}
var err error
tx := MustTx(boil.Begin())
defer tx.Rollback()
var a {{$rel.LocalTable.NameGo}}

View file

@ -4,10 +4,7 @@
{{- range .Table.FKeys -}}
{{- $rel := textsFromForeignKey $dot.Tables $dot.Table . -}}
func Test{{$rel.LocalTable.NameGo}}ToOne{{$rel.ForeignTable.NameGo}}_{{$rel.LocalTable.ColumnNameGo}}(t *testing.T) {
tx, err := boil.Begin()
if err != nil {
t.Fatal(err)
}
tx := MustTx(boil.Begin())
defer tx.Rollback()
var foreign {{$rel.ForeignTable.NameGo}}