@@ -193,26 +193,15 @@ def test_password_change_reuse_validation(self):
193193 self .user = User .objects .get (username = "fred" ) # get user again so that you can see password changed
194194 self .assertEquals (self .user .check_password ("IchangedTHEpassword#123" ), True )
195195
196- # add 12 minutes to time to expire current password
197- StubDate .now = classmethod (
198- lambda cls , timezone : datetime .now ().replace (tzinfo = pytz .UTC ) + relativedelta (minutes = + 12 )
199- )
200- self .client .logout ()
201- form_data = {'username' : 'fred' ,
202- 'password' : 'IchangedTHEpassword#123' }
203- response = self .client .post (reverse ('login' ), form_data , follow = True )
204- self .assertContains (response ,
205- ("Your password has expired, change password strongly recommended." ))
206-
207196 @override_switch ('login' , active = True )
208197 @mock .patch ("apps.accounts.validators.datetime" , StubDate )
209- def test_password_expire_not_affect_staff (self ):
198+ def test_no_password_expire (self ):
210199 self .client .logout ()
211- # add 20 minutes to time to show staff is not effected
200+ # add 90 days to time to show expiration is removed
212201 StubDate .now = classmethod (
213- lambda cls , timezone : datetime .now ().replace (tzinfo = pytz .UTC ) + relativedelta (minutes = + 20 )
202+ lambda cls , timezone : datetime .now ().replace (tzinfo = pytz .UTC ) + relativedelta (days = + 90 )
214203 )
215- form_data = {'username' : 'staff ' ,
204+ form_data = {'username' : 'fred ' ,
216205 'password' : 'foobarfoobarfoobar' }
217206 response = self .client .post (reverse ('login' ), form_data , follow = True )
218207 # assert account dashboard page
@@ -222,8 +211,5 @@ def test_password_expire_not_affect_staff(self):
222211 ("The Developer Sandbox lets you register applications to get credentials" ))
223212
224213 def test_password_reuse_min_age_validator_args_check (self ):
225- with self .assertRaisesRegex (ValueError ,
226- (".*password_min_age < password_reuse_interval expected.*"
227- "password_expire < password_reuse_interval expected.*"
228- "password_min_age < password_expire expected.*" )):
229- PasswordReuseAndMinAgeValidator (60 * 60 * 24 * 30 , 60 * 60 * 24 * 10 , 60 * 60 * 24 * 20 )
214+ with self .assertRaisesRegex (ValueError , ".*password_min_age < password_reuse_interval expected.*" ):
215+ PasswordReuseAndMinAgeValidator (60 * 60 * 24 * 30 , 60 * 60 * 24 * 10 )
0 commit comments