MCPcopy
hub / github.com/pocketbase/pocketbase / createTestSuperusers

Function createTestSuperusers

core/system_alert_test.go:107–124  ·  view source on GitHub ↗
(app App, total int)

Source from the content-addressed store, hash-verified

105}
106
107func createTestSuperusers(app App, total int) error {
108 superusersCollection, err := app.FindCollectionByNameOrId(CollectionNameSuperusers)
109 if err != nil {
110 return err
111 }
112
113 for i := range total {
114 superuser := NewRecord(superusersCollection)
115 superuser.SetEmail("test" + strconv.Itoa(i+1) + "@example.com")
116 superuser.SetRandomPassword()
117
118 if err := app.Save(superuser); err != nil {
119 return err
120 }
121 }
122
123 return nil
124}

Callers 2

TestSendSystemAlertFunction · 0.85

Calls 5

SetEmailMethod · 0.95
SetRandomPasswordMethod · 0.95
NewRecordFunction · 0.85
SaveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…