mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
chore(lint): Add exceptions for dbfs_model and unittest (#10275)
Thanks a lot to @floss4good who pointed this out in the comments of #10253! Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10275 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: floss4good <floss4good@noreply.codeberg.org> Co-authored-by: nachtjasmin <nachtjasmin@posteo.de> Co-committed-by: nachtjasmin <nachtjasmin@posteo.de>
This commit is contained in:
parent
f43d48d5c8
commit
70166de15a
11 changed files with 38 additions and 54 deletions
|
|
@ -6,7 +6,7 @@ package avatars_test
|
|||
import (
|
||||
"testing"
|
||||
|
||||
avatar_model "forgejo.org/models/avatars"
|
||||
avatars_model "forgejo.org/models/avatars"
|
||||
"forgejo.org/models/db"
|
||||
system_model "forgejo.org/models/system"
|
||||
"forgejo.org/modules/setting"
|
||||
|
|
@ -34,11 +34,11 @@ func enableGravatar(t *testing.T) {
|
|||
func TestHashEmail(t *testing.T) {
|
||||
assert.Equal(t,
|
||||
"d41d8cd98f00b204e9800998ecf8427e",
|
||||
avatar_model.HashEmail(""),
|
||||
avatars_model.HashEmail(""),
|
||||
)
|
||||
assert.Equal(t,
|
||||
"353cbad9b58e69c96154ad99f92bedc7",
|
||||
avatar_model.HashEmail("gitea@example.com"),
|
||||
avatars_model.HashEmail("gitea@example.com"),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -48,12 +48,12 @@ func TestSizedAvatarLink(t *testing.T) {
|
|||
disableGravatar(t)
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
assert.Equal(t, "/testsuburl/assets/img/avatar_default.png",
|
||||
avatar_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100))
|
||||
avatars_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100))
|
||||
|
||||
enableGravatar(t)
|
||||
config.GetDynGetter().InvalidateCache()
|
||||
assert.Equal(t,
|
||||
"https://secure.gravatar.com/avatar/353cbad9b58e69c96154ad99f92bedc7?d=identicon&s=100",
|
||||
avatar_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100),
|
||||
avatars_model.GenerateEmailAvatarFastLink(db.DefaultContext, "gitea@example.com", 100),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue