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

Function TestGenerateActivateCode

internal/userutil/userutil_test.go:31–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

29}
30
31func TestGenerateActivateCode(t *testing.T) {
32 conf.SetMockAuth(t,
33 conf.AuthOpts{
34 ActivateCodeLives: 10,
35 },
36 )
37
38 code := GenerateActivateCode(1, "alice@example.com", "Alice", "123456", "rands")
39 got := tool.VerifyTimeLimitCode("1alice@example.comalice123456rands", conf.Auth.ActivateCodeLives, code[:tool.TimeLimitCodeLength])
40 assert.True(t, got)
41}
42
43func TestCustomAvatarPath(t *testing.T) {
44 if runtime.GOOS == "windows" {

Callers

nothing calls this directly

Calls 3

SetMockAuthFunction · 0.92
VerifyTimeLimitCodeFunction · 0.92
GenerateActivateCodeFunction · 0.85

Tested by

no test coverage detected