summaryrefslogtreecommitdiffstats
path: root/integrations/signup_test.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-04-03 17:46:48 +0800
committerGitHub <noreply@github.com>2022-04-03 17:46:48 +0800
commitd242511e86c3a6d8a7013100845d2cdc8eb5252c (patch)
tree391b7fa946d32b44f06a274453e4b4d1a19fe8ee /integrations/signup_test.go
parent27c34dd011cceb8232d1c3307f87b53a147c75c3 (diff)
downloadgitea-d242511e86c3a6d8a7013100845d2cdc8eb5252c.tar.gz
gitea-d242511e86c3a6d8a7013100845d2cdc8eb5252c.zip
Remove legacy unmaintained packages, refactor to support change default locale (#19308)
Remove two unmaintained vendor packages `i18n` and `paginater`. Changes: * Rewrite `i18n` package with a more clear fallback mechanism. Fix an unstable `Tr` behavior, add more tests. * Refactor the legacy `Paginater` to `Paginator`, test cases are kept unchanged. Trivial enhancement (no breaking for end users): * Use the first locale in LANGS setting option as the default, add a log to prevent from surprising users.
Diffstat (limited to 'integrations/signup_test.go')
-rw-r--r--integrations/signup_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/integrations/signup_test.go b/integrations/signup_test.go
index 87dea2fbe7..7b45674376 100644
--- a/integrations/signup_test.go
+++ b/integrations/signup_test.go
@@ -13,9 +13,9 @@ import (
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/translation/i18n"
"github.com/stretchr/testify/assert"
- "github.com/unknwon/i18n"
)
func TestSignup(t *testing.T) {
@@ -68,9 +68,9 @@ func TestSignupEmail(t *testing.T) {
wantStatus int
wantMsg string
}{
- {"exampleUser@example.com\r\n", http.StatusOK, i18n.Tr("en", "form.email_invalid", nil)},
- {"exampleUser@example.com\r", http.StatusOK, i18n.Tr("en", "form.email_invalid", nil)},
- {"exampleUser@example.com\n", http.StatusOK, i18n.Tr("en", "form.email_invalid", nil)},
+ {"exampleUser@example.com\r\n", http.StatusOK, i18n.Tr("en", "form.email_invalid")},
+ {"exampleUser@example.com\r", http.StatusOK, i18n.Tr("en", "form.email_invalid")},
+ {"exampleUser@example.com\n", http.StatusOK, i18n.Tr("en", "form.email_invalid")},
{"exampleUser@example.com", http.StatusSeeOther, ""},
}