Ignore columns with defaults in randomize
This commit is contained in:
parent
6fad1bd148
commit
54f960659b
1 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ func test{{$tableNamePlural}}Update(t *testing.T) {
|
|||
seed := randomize.NewSeed()
|
||||
var err error
|
||||
{{$varNameSingular}} := &{{$tableNameSingular}}{}
|
||||
if err = randomize.Struct(seed, {{$varNameSingular}}, {{$varNameSingular}}DBTypes, true); err != nil {
|
||||
if err = randomize.Struct(seed, {{$varNameSingular}}, {{$varNameSingular}}DBTypes, true, {{$varNameSingular}}ColumnsWithDefault...); err != nil {
|
||||
t.Errorf("Unable to randomize {{$tableNameSingular}} struct: %s", err)
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ func test{{$tableNamePlural}}SliceUpdateAll(t *testing.T) {
|
|||
seed := randomize.NewSeed()
|
||||
var err error
|
||||
{{$varNameSingular}} := &{{$tableNameSingular}}{}
|
||||
if err = randomize.Struct(seed, {{$varNameSingular}}, {{$varNameSingular}}DBTypes, true); err != nil {
|
||||
if err = randomize.Struct(seed, {{$varNameSingular}}, {{$varNameSingular}}DBTypes, true, {{$varNameSingular}}ColumnsWithDefault...); err != nil {
|
||||
t.Errorf("Unable to randomize {{$tableNameSingular}} struct: %s", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue