From 5b97a172355adb890c3d7599dd59992567562a55 Mon Sep 17 00:00:00 2001 From: Aaron L Date: Sat, 17 Sep 2016 00:09:56 -0700 Subject: [PATCH] Fix erroneous generation of 1-to-1 setop remove --- templates_test/singleton/boil_suites_test.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates_test/singleton/boil_suites_test.tpl b/templates_test/singleton/boil_suites_test.tpl index 68ae6d3..3749a07 100644 --- a/templates_test/singleton/boil_suites_test.tpl +++ b/templates_test/singleton/boil_suites_test.tpl @@ -252,8 +252,10 @@ func TestToManyRemove(t *testing.T) { {{- $rel := textsFromRelationship $dot.Tables $table . -}} {{- if (and .ForeignColumnUnique (not .ToJoinTable)) -}} {{- $oneToOne := textsFromOneToOneRelationship $dot.PkgName $dot.Tables $table . -}} + {{- if $oneToOne.ForeignKey.Nullable -}} t.Run("{{$oneToOne.LocalTable.NameGo}}OneToOne{{$oneToOne.ForeignTable.NameGo}}_{{$oneToOne.Function.Name}}", test{{$oneToOne.LocalTable.NameGo}}ToOneRemoveOp{{$oneToOne.ForeignTable.NameGo}}_{{$oneToOne.Function.Name}}) - {{else -}} + {{end -}} + {{- else -}} t.Run("{{$rel.LocalTable.NameGo}}ToMany{{$rel.Function.Name}}", test{{$rel.LocalTable.NameGo}}ToManyRemoveOp{{$rel.Function.Name}}) {{end -}}{{- /* if unique */ -}} {{- end -}}{{- /* if foreign column nullable */ -}}