add option db.WithSkipVetForWrite(true) so the db tests don't get intercepted by app validation (#332)
This commit is contained in:
4 files changed
+15
-15
No files matched your search
@@ -96,7 +96,7 @@ func TestRootKeyVersion_ImmutableFields(t *testing.T) {
|
||||
|
||||
err = tt.update.Encrypt(context.Background(), wrapper)
|
||||
require.NoError(err)
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil)
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil, db.WithSkipVetForWrite(true))
|
||||
require.Error(err)
|
||||
assert.Equal(0, rowsUpdated)
|
||||
|
||||
@@ -163,7 +163,7 @@ func TestRootKey_ImmutableFields(t *testing.T) {
|
||||
err := rw.LookupById(context.Background(), orig)
|
||||
require.NoError(err)
|
||||
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil)
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil, db.WithSkipVetForWrite(true))
|
||||
require.Error(err)
|
||||
assert.Equal(0, rowsUpdated)
|
||||
|
||||
@@ -232,7 +232,7 @@ func TestDatabaseKey_ImmutableFields(t *testing.T) {
|
||||
err := rw.LookupById(context.Background(), orig)
|
||||
require.NoError(err)
|
||||
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil)
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil, db.WithSkipVetForWrite(true))
|
||||
require.Error(err)
|
||||
assert.Equal(0, rowsUpdated)
|
||||
|
||||
@@ -331,7 +331,7 @@ func TestDatabaseKeyVersion_ImmutableFields(t *testing.T) {
|
||||
|
||||
err = tt.update.Encrypt(context.Background(), wrapper)
|
||||
require.NoError(err)
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil)
|
||||
rowsUpdated, err := rw.Update(context.Background(), tt.update, tt.fieldMask, nil, db.WithSkipVetForWrite(true))
|
||||
require.Error(err)
|
||||
assert.Equal(0, rowsUpdated)
|
||||
|
||||
|
||||
Reference in new issue
Block a user