MCPcopy
hub / github.com/pocketbase/pocketbase / TestRecordSaveIdUpdateNoValidation

Function TestRecordSaveIdUpdateNoValidation

core/record_model_test.go:2121–2145  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2119}
2120
2121func TestRecordSaveIdUpdateNoValidation(t *testing.T) {
2122 t.Parallel()
2123
2124 app, _ := tests.NewTestApp()
2125 defer app.Cleanup()
2126
2127 rec, err := app.FindRecordById("demo3", "7nwo8tuiatetxdm")
2128 if err != nil {
2129 t.Fatal(err)
2130 }
2131
2132 rec.Id = strings.Repeat("a", 15)
2133
2134 err = app.SaveNoValidate(rec)
2135 if err == nil {
2136 t.Fatal("Expected save to fail, got nil")
2137 }
2138
2139 // no changes
2140 rec.Load(rec.Original().FieldsData())
2141 err = app.SaveNoValidate(rec)
2142 if err != nil {
2143 t.Fatalf("Expected save to succeed, got error %v", err)
2144 }
2145}
2146
2147func TestRecordSaveWithAutoTokenKeyRefresh(t *testing.T) {
2148 t.Parallel()

Callers

nothing calls this directly

Calls 7

CleanupMethod · 0.95
NewTestAppFunction · 0.92
FieldsDataMethod · 0.80
OriginalMethod · 0.80
FindRecordByIdMethod · 0.65
SaveNoValidateMethod · 0.65
LoadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…