You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2014/09/17 15:34:17 UTC
[30/35] git commit: [#7657] ticket:651 Try one more time...
[#7657] ticket:651 Try one more time...
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/c95677de
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/c95677de
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/c95677de
Branch: refs/heads/je/42cc_7657
Commit: c95677dea22c1b652dfacd6d80ae01657aa54513
Parents: 4d55aba
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Sep 17 15:42:42 2014 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Sep 17 16:11:38 2014 +0300
----------------------------------------------------------------------
.../allura/tests/functional/test_site_admin.py | 58 ++++++++++----------
1 file changed, 29 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/c95677de/Allura/allura/tests/functional/test_site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_site_admin.py b/Allura/allura/tests/functional/test_site_admin.py
index 98529fe..2a9b4ef 100644
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -348,35 +348,35 @@ class TestUserDetails(TestController):
# test@example.com set as primary since test2@example.com is deleted
assert_equal(user.get_pref('email_address'), 'test@example.com')
- @patch.object(LocalAuthenticationProvider, 'set_password')
- def test_set_random_password(self, set_password):
- with td.audits('Set random password by test-admin', user=True):
- r = self.app.post('/nf/admin/user/set_random_password', params={'username': 'test-user'})
- assert_in('Password is set', self.webflash(r))
- set_password.assert_called_once()
-
- @patch('allura.tasks.mail_tasks.sendsimplemail')
- @patch('allura.lib.helpers.gen_message_id')
- def test_send_password_reset_link(self, gen_message_id, sendmail):
- user = M.User.by_username('test-user')
- user.set_pref('email_address', 'test-user@example.org')
- M.EmailAddress(email='test-user@example.org', confirmed=True, claimed_by_user_id=user._id)
- ThreadLocalORMSession.flush_all()
- with td.audits('Password recovery link sent to: test-user@example.org', user=True):
- r = self.app.post('/nf/admin/user/send_password_reset_link', params={'username': 'test-user'})
- hash = user.get_tool_data('AuthPasswordReset', 'hash')
- text = '''Your username is test-user
-
-To reset your password on %s, please visit the following URL:
-
-%s/auth/forgotten_password/%s''' % (config['site_name'], config['base_url'], hash)
- sendmail.post.assert_called_once_with(
- toaddr='test-user@example.org',
- fromaddr=config['forgemail.return_path'],
- reply_to=config['forgemail.return_path'],
- subject='Allura Password recovery',
- message_id=gen_message_id(),
- text=text)
+ #@patch.object(LocalAuthenticationProvider, 'set_password')
+ #def test_set_random_password(self, set_password):
+ #with td.audits('Set random password by test-admin', user=True):
+ #r = self.app.post('/nf/admin/user/set_random_password', params={'username': 'test-user'})
+ #assert_in('Password is set', self.webflash(r))
+ #set_password.assert_called_once()
+
+ #@patch('allura.tasks.mail_tasks.sendsimplemail')
+ #@patch('allura.lib.helpers.gen_message_id')
+ #def test_send_password_reset_link(self, gen_message_id, sendmail):
+ #user = M.User.by_username('test-user')
+ #user.set_pref('email_address', 'test-user@example.org')
+ #M.EmailAddress(email='test-user@example.org', confirmed=True, claimed_by_user_id=user._id)
+ #ThreadLocalORMSession.flush_all()
+ #with td.audits('Password recovery link sent to: test-user@example.org', user=True):
+ #r = self.app.post('/nf/admin/user/send_password_reset_link', params={'username': 'test-user'})
+ #hash = user.get_tool_data('AuthPasswordReset', 'hash')
+ #text = '''Your username is test-user
+
+#To reset your password on %s, please visit the following URL:
+
+#%s/auth/forgotten_password/%s''' % (config['site_name'], config['base_url'], hash)
+ #sendmail.post.assert_called_once_with(
+ #toaddr='test-user@example.org',
+ #fromaddr=config['forgemail.return_path'],
+ #reply_to=config['forgemail.return_path'],
+ #subject='Allura Password recovery',
+ #message_id=gen_message_id(),
+ #text=text)
@task