File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ import json
1
2
from unittest import mock
2
3
3
4
from django .conf import settings
@@ -397,6 +398,19 @@ def test_missing_management_data(self):
397
398
# view should return HTTP 400 Bad Request
398
399
self .assertEqual (response .status_code , 400 )
399
400
401
+ def test_no_password_in_session (self ):
402
+ self .create_user ()
403
+ self .enable_otp ()
404
+
405
+ response = self .
_post ({
'auth-username' :
'[email protected] ' ,
406
+ 'auth-password' : 'secret' ,
407
+ 'login_view-current_step' : 'auth' })
408
+ self .assertContains (response , 'Token:' )
409
+
410
+ session_contents = json .dumps (list (self .client .session .items ()))
411
+
412
+ self .assertNotIn ('secret' , session_contents )
413
+
400
414
401
415
class BackupTokensTest (UserMixin , TestCase ):
402
416
def setUp (self ):
You can’t perform that action at this time.
0 commit comments