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/22 12:28:10 UTC

[29/31] git commit: Revert "[#7657] ticket:651 Try one more time..."

Revert "[#7657] ticket:651 Try one more time..."

This reverts commit c95677dea22c1b652dfacd6d80ae01657aa54513.


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/5674259a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/5674259a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/5674259a

Branch: refs/heads/je/42cc_7657b
Commit: 5674259a202200584df1d82fb19434eca008ee66
Parents: 2e490dc
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Sep 22 11:00:51 2014 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Sep 22 11:14:58 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/5674259a/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 a64dfa9..4df31e8 100644
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -472,35 +472,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