MCPcopy Create free account
hub / github.com/gogs/gogs / usersGetMailableEmailsByUsernames

Function usersGetMailableEmailsByUsernames

internal/database/users_test.go:832–844  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, s *UsersStore)

Source from the content-addressed store, hash-verified

830}
831
832func usersGetMailableEmailsByUsernames(t *testing.T, ctx context.Context, s *UsersStore) {
833 alice, err := s.Create(ctx, "alice", "alice@example.com", CreateUserOptions{})
834 require.NoError(t, err)
835 bob, err := s.Create(ctx, "bob", "bob@example.com", CreateUserOptions{Activated: true})
836 require.NoError(t, err)
837 _, err = s.Create(ctx, "cindy", "cindy@example.com", CreateUserOptions{Activated: true})
838 require.NoError(t, err)
839
840 got, err := s.GetMailableEmailsByUsernames(ctx, []string{alice.Name, bob.Name, "ignore-non-exist"})
841 require.NoError(t, err)
842 want := []string{bob.Email}
843 assert.Equal(t, want, got)
844}
845
846func usersIsUsernameUsed(t *testing.T, ctx context.Context, s *UsersStore) {
847 alice, err := s.Create(ctx, "alice", "alice@example.com", CreateUserOptions{})

Callers

nothing calls this directly

Calls 2

CreateMethod · 0.45

Tested by

no test coverage detected