comparison MoinMoin/_tests/test_user.py @ 5746:ff282aaf7912

Replace test password hashes (for APR1 and DES) with htpasswd generated
author pavel_vinogradov
date Wed, 01 Dec 2010 20:31:16 +0300
parents 9135c31be7a6
children 783ef0975edb
comparison
equal deleted inserted replaced
5745:9135c31be7a6 5746:ff282aaf7912
98 """ 98 """
99 Create user with {APR1} password and check that user can login. 99 Create user with {APR1} password and check that user can login.
100 """ 100 """
101 # Create test user 101 # Create test user
102 name = u'Test User' 102 name = u'Test User'
103 password = '{APR1}$apr1$salt$kKtoJ6r.fd87EWbzq2TiF0' # 12345 103 # generated with "htpasswd -nbm blaze 12345"
104 password = '{APR1}$apr1$NG3VoiU5$PSpHT6tV0ZMKkSZ71E3qg.' # 12345
104 self.createUser(name, password, True) 105 self.createUser(name, password, True)
105 106
106 # Try to "login" 107 # Try to "login"
107 theuser = user.User(self.request, name=name, password='12345') 108 theuser = user.User(self.request, name=name, password='12345')
108 assert theuser.valid 109 assert theuser.valid
124 """ 125 """
125 Create user with {DES} password and check that user can login. 126 Create user with {DES} password and check that user can login.
126 """ 127 """
127 # Create test user 128 # Create test user
128 name = u'Test User' 129 name = u'Test User'
129 password = '{DES}sajEeYaHYyeSU' # 12345 130 # generated with "htpasswd -nbd blaze 12345"
131 password = '{DES}gArsfn7O5Yqfo' # 12345
130 self.createUser(name, password, True) 132 self.createUser(name, password, True)
131 133
132 try: 134 try:
133 import crypt 135 import crypt
134 # Try to "login" 136 # Try to "login"
195 Create user with {APR1} password and check that logging in 197 Create user with {APR1} password and check that logging in
196 upgrades to {SSHA}. 198 upgrades to {SSHA}.
197 """ 199 """
198 # Create test user 200 # Create test user
199 name = u'Test User' 201 name = u'Test User'
200 password = '{APR1}$apr1$salt$kKtoJ6r.fd87EWbzq2TiF0' # 12345 202 # generated with "htpasswd -nbm blaze 12345"
203 password = '{APR1}$apr1$NG3VoiU5$PSpHT6tV0ZMKkSZ71E3qg.' # 12345
201 self.createUser(name, password, True) 204 self.createUser(name, password, True)
202 205
203 # User is not required to be valid 206 # User is not required to be valid
204 theuser = user.User(self.request, name=name, password='12345') 207 theuser = user.User(self.request, name=name, password='12345')
205 assert theuser.enc_password[:6] == '{SSHA}' 208 assert theuser.enc_password[:6] == '{SSHA}'
223 Create user with {DES} password and check that logging in 226 Create user with {DES} password and check that logging in
224 upgrades to {SSHA}. 227 upgrades to {SSHA}.
225 """ 228 """
226 # Create test user 229 # Create test user
227 name = u'Test User' 230 name = u'Test User'
228 password = '{DES}sajEeYaHYyeSU' # 12345 231 # generated with "htpasswd -nbm blaze 12345"
232 password = '{DES}gArsfn7O5Yqfo' # 12345
229 self.createUser(name, password, True) 233 self.createUser(name, password, True)
230 234
231 # User is not required to be valid 235 # User is not required to be valid
232 theuser = user.User(self.request, name=name, password='12345') 236 theuser = user.User(self.request, name=name, password='12345')
233 assert theuser.enc_password[:6] == '{SSHA}' 237 assert theuser.enc_password[:6] == '{SSHA}'