More app code migration (#5170)
* Migrate admin functions into app package * More user function refactoring * Move post functions into app package
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
8ed665cb76
Коммит
d245b29f82
@@ -83,32 +83,6 @@ func TestCreateUser(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckUserDomain(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
user := th.BasicUser
|
||||
|
||||
cases := []struct {
|
||||
domains string
|
||||
matched bool
|
||||
}{
|
||||
{"simulator.amazonses.com", true},
|
||||
{"gmail.com", false},
|
||||
{"", true},
|
||||
{"gmail.com simulator.amazonses.com", true},
|
||||
}
|
||||
for _, c := range cases {
|
||||
matched := CheckUserDomain(user, c.domains)
|
||||
if matched != c.matched {
|
||||
if c.matched {
|
||||
t.Logf("'%v' should have matched '%v'", user.Email, c.domains)
|
||||
} else {
|
||||
t.Logf("'%v' should not have matched '%v'", user.Email, c.domains)
|
||||
}
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestLogin(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
Client := th.BasicClient
|
||||
@@ -1356,6 +1330,7 @@ func TestResetPassword(t *testing.T) {
|
||||
}
|
||||
|
||||
if _, err := Client.ResetPassword(recovery.Code, "newpwd1"); err != nil {
|
||||
t.Log(recovery.Code)
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user