comparison MoinMoin/_tests/test_user.py @ 5786:8cb5ab136b87

fix trailing blanks
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 02 Aug 2011 23:24:38 +0200
parents 783ef0975edb
children 5126fadbf24f
comparison
equal deleted inserted replaced
5785:62202e5435e2 5786:8cb5ab136b87
101 # Create test user 101 # Create test user
102 name = u'Test User' 102 name = u'Test User'
103 # generated with "htpasswd -nbm blaze 12345" 103 # generated with "htpasswd -nbm blaze 12345"
104 password = '{APR1}$apr1$NG3VoiU5$PSpHT6tV0ZMKkSZ71E3qg.' # 12345 104 password = '{APR1}$apr1$NG3VoiU5$PSpHT6tV0ZMKkSZ71E3qg.' # 12345
105 self.createUser(name, password, True) 105 self.createUser(name, password, True)
106 106
107 # Try to "login" 107 # Try to "login"
108 theuser = user.User(self.request, name=name, password='12345') 108 theuser = user.User(self.request, name=name, password='12345')
109 assert theuser.valid 109 assert theuser.valid
110 110
111 def test_auth_with_md5_stored_password(self): 111 def test_auth_with_md5_stored_password(self):
114 """ 114 """
115 # Create test user 115 # Create test user
116 name = u'Test User' 116 name = u'Test User'
117 password = '{MD5}$1$salt$etVYf53ma13QCiRbQOuRk/' # 12345 117 password = '{MD5}$1$salt$etVYf53ma13QCiRbQOuRk/' # 12345
118 self.createUser(name, password, True) 118 self.createUser(name, password, True)
119 119
120 # Try to "login" 120 # Try to "login"
121 theuser = user.User(self.request, name=name, password='12345') 121 theuser = user.User(self.request, name=name, password='12345')
122 assert theuser.valid 122 assert theuser.valid
123 123
124 def test_auth_with_des_stored_password(self): 124 def test_auth_with_des_stored_password(self):
128 # Create test user 128 # Create test user
129 name = u'Test User' 129 name = u'Test User'
130 # generated with "htpasswd -nbd blaze 12345" 130 # generated with "htpasswd -nbd blaze 12345"
131 password = '{DES}gArsfn7O5Yqfo' # 12345 131 password = '{DES}gArsfn7O5Yqfo' # 12345
132 self.createUser(name, password, True) 132 self.createUser(name, password, True)
133 133
134 try: 134 try:
135 import crypt 135 import crypt
136 # Try to "login" 136 # Try to "login"
137 theuser = user.User(self.request, name=name, password='12345') 137 theuser = user.User(self.request, name=name, password='12345')
138 assert theuser.valid 138 assert theuser.valid
139 except ImportError: 139 except ImportError:
140 py.test.skip("Platform does not provide crypt module!") 140 py.test.skip("Platform does not provide crypt module!")
141 141
142 def testSubscriptionSubscribedPage(self): 142 def testSubscriptionSubscribedPage(self):
143 """ user: tests isSubscribedTo """ 143 """ user: tests isSubscribedTo """
144 pagename = u'HelpMiscellaneous' 144 pagename = u'HelpMiscellaneous'
145 name = u'__Jürgen Herman__' 145 name = u'__Jürgen Herman__'
146 password = name 146 password = name
186 """ 186 """
187 name = u'/no such user/' 187 name = u'/no such user/'
188 password = '{SHA}jLIjfQZ5yojbZGTqxg2pY0VROWQ=' # 12345 188 password = '{SHA}jLIjfQZ5yojbZGTqxg2pY0VROWQ=' # 12345
189 self.createUser(name, password, True) 189 self.createUser(name, password, True)
190 190
191 # User is not required to be valid 191 # User is not required to be valid
192 theuser = user.User(self.request, name=name, password='12345') 192 theuser = user.User(self.request, name=name, password='12345')
193 assert theuser.enc_password[:6] == '{SSHA}' 193 assert theuser.enc_password[:6] == '{SSHA}'
194 194
195 def test_upgrade_password_from_apr1_to_ssha(self): 195 def test_upgrade_password_from_apr1_to_ssha(self):
196 """ 196 """
197 Create user with {APR1} password and check that logging in 197 Create user with {APR1} password and check that logging in
200 # Create test user 200 # Create test user
201 name = u'Test User' 201 name = u'Test User'
202 # generated with "htpasswd -nbm blaze 12345" 202 # generated with "htpasswd -nbm blaze 12345"
203 password = '{APR1}$apr1$NG3VoiU5$PSpHT6tV0ZMKkSZ71E3qg.' # 12345 203 password = '{APR1}$apr1$NG3VoiU5$PSpHT6tV0ZMKkSZ71E3qg.' # 12345
204 self.createUser(name, password, True) 204 self.createUser(name, password, True)
205 205
206 # User is not required to be valid 206 # User is not required to be valid
207 theuser = user.User(self.request, name=name, password='12345') 207 theuser = user.User(self.request, name=name, password='12345')
208 assert theuser.enc_password[:6] == '{SSHA}' 208 assert theuser.enc_password[:6] == '{SSHA}'
209 209
210 def test_upgrade_password_from_md5_to_ssha(self): 210 def test_upgrade_password_from_md5_to_ssha(self):
214 """ 214 """
215 # Create test user 215 # Create test user
216 name = u'Test User' 216 name = u'Test User'
217 password = '{MD5}$1$salt$etVYf53ma13QCiRbQOuRk/' # 12345 217 password = '{MD5}$1$salt$etVYf53ma13QCiRbQOuRk/' # 12345
218 self.createUser(name, password, True) 218 self.createUser(name, password, True)
219 219
220 # User is not required to be valid 220 # User is not required to be valid
221 theuser = user.User(self.request, name=name, password='12345') 221 theuser = user.User(self.request, name=name, password='12345')
222 assert theuser.enc_password[:6] == '{SSHA}' 222 assert theuser.enc_password[:6] == '{SSHA}'
223 223
224 def test_upgrade_password_from_des_to_ssha(self): 224 def test_upgrade_password_from_des_to_ssha(self):
229 # Create test user 229 # Create test user
230 name = u'Test User' 230 name = u'Test User'
231 # generated with "htpasswd -nbd blaze 12345" 231 # generated with "htpasswd -nbd blaze 12345"
232 password = '{DES}gArsfn7O5Yqfo' # 12345 232 password = '{DES}gArsfn7O5Yqfo' # 12345
233 self.createUser(name, password, True) 233 self.createUser(name, password, True)
234 234
235 # User is not required to be valid 235 # User is not required to be valid
236 theuser = user.User(self.request, name=name, password='12345') 236 theuser = user.User(self.request, name=name, password='12345')
237 assert theuser.enc_password[:6] == '{SSHA}' 237 assert theuser.enc_password[:6] == '{SSHA}'
238 238
239 def test_for_email_attribute_by_name(self): 239 def test_for_email_attribute_by_name(self):
240 """ 240 """