allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#7718] send email addr instead of EmailAddress _id into sendsimplemail
Date Wed, 24 Sep 2014 02:52:18 GMT
Repository: allura
Updated Branches:
  refs/heads/db/7718 [created] 84a82c391


[#7718] send email addr instead of EmailAddress _id into sendsimplemail


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

Branch: refs/heads/db/7718
Commit: 84a82c3910014a290bb959ba3aee6ff50411d4d2
Parents: e3316fd
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Wed Sep 24 02:51:45 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Sep 24 02:51:45 2014 +0000

----------------------------------------------------------------------
 Allura/allura/model/auth.py            |  4 ++--
 Allura/allura/tests/model/test_auth.py | 17 +++++++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/84a82c39/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 7f99866..752266e 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -157,8 +157,8 @@ please visit the following URL:
         allura.tasks.mail_tasks.sendsimplemail.post(
             fromaddr=g.noreply,
             reply_to=g.noreply,
-            toaddr=self._id,
-            subject='%s - Email address verification' % config['site_name'],
+            toaddr=self.email,
+            subject=u'%s - Email address verification' % config['site_name'],
             message_id=h.gen_message_id(),
             text=text)
 

http://git-wip-us.apache.org/repos/asf/allura/blob/84a82c39/Allura/allura/tests/model/test_auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_auth.py b/Allura/allura/tests/model/test_auth.py
index 75cf5a2..3d6b69e 100644
--- a/Allura/allura/tests/model/test_auth.py
+++ b/Allura/allura/tests/model/test_auth.py
@@ -65,12 +65,25 @@ def test_email_address():
     assert addr2
     addr4 = M.EmailAddress.create('test@DOMAIN.NET')
     assert addr4 is not addr2
-    with patch('allura.lib.app_globals.request', Request.blank('/')):
-        addr.send_verification_link()
+
     assert addr is c.user.address_object('test_admin@domain.net')
     c.user.claim_address('test@DOMAIN.NET')
     assert 'test@domain.net' in c.user.email_addresses
 
+
+@with_setup(setUp)
+def test_email_address_send_verification_link():
+    addr = M.EmailAddress(email='test_admin@domain.net',
+                          claimed_by_user_id=c.user._id)
+
+    addr.send_verification_link()
+
+    with patch('allura.tasks.mail_tasks.smtp_client._client') as _client:
+        M.MonQTask.run_ready()
+    return_path, rcpts, body = _client.sendmail.call_args[0]
+    assert_equal(rcpts, ['test_admin@domain.net'])
+
+
 @td.with_user_project('test-admin')
 @with_setup(setUp)
 def test_user():


Mime
View raw message