Ticket #12103: 12103_tests.diff
File 12103_tests.diff, 779 bytes (added by , 15 years ago) |
---|
-
django/contrib/auth/tests/forms.py
False 105 105 >>> user.is_active = True 106 106 >>> user.save() 107 107 108 # The user is inactive but allowed to login 109 110 >>> data = { 111 ... 'username': 'jsmith', 112 ... 'password': 'test123', 113 ... } 114 >>> user.is_active = False 115 >>> user.save() 116 >>> class AuthenticationFormWithInactiveUsersOkay(AuthenticationForm): 117 ... def confirm_login_allowed(self, user): 118 ... pass 119 >>> form = AuthenticationFormWithInactiveUsersOkay(None, data) 120 >>> form.is_valid() 121 True 122 123 >>> user.is_active = True 124 >>> user.save() 125 108 126 # The success case 109 127 110 128 >>> form = AuthenticationForm(None, data)