@@ -80,19 +80,22 @@ func TestChangePassword(t *testing.T) {
80
80
PasswordComplexity : pcLU ,
81
81
},
82
82
} {
83
- unittest .PrepareTestEnv (t )
84
- ctx := test .MockContext (t , "user/settings/security" )
85
- test .LoadUser (t , ctx , 2 )
86
- test .LoadRepo (t , ctx , 1 )
83
+ t .Run (req .OldPassword + "__" + req .NewPassword , func (t * testing.T ) {
84
+ unittest .PrepareTestEnv (t )
85
+ setting .PasswordComplexity = req .PasswordComplexity
86
+ ctx := test .MockContext (t , "user/settings/security" )
87
+ test .LoadUser (t , ctx , 2 )
88
+ test .LoadRepo (t , ctx , 1 )
87
89
88
- web .SetForm (ctx , & forms.ChangePasswordForm {
89
- OldPassword : req .OldPassword ,
90
- Password : req .NewPassword ,
91
- Retype : req .Retype ,
92
- })
93
- AccountPost (ctx )
90
+ web .SetForm (ctx , & forms.ChangePasswordForm {
91
+ OldPassword : req .OldPassword ,
92
+ Password : req .NewPassword ,
93
+ Retype : req .Retype ,
94
+ })
95
+ AccountPost (ctx )
94
96
95
- assert .Contains (t , ctx .Flash .ErrorMsg , req .Message )
96
- assert .EqualValues (t , http .StatusSeeOther , ctx .Resp .Status ())
97
+ assert .Contains (t , ctx .Flash .ErrorMsg , req .Message )
98
+ assert .EqualValues (t , http .StatusSeeOther , ctx .Resp .Status ())
99
+ })
97
100
}
98
101
}
0 commit comments