allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject [09/17] allura git commit: [#7704] ticket:662 Fixed tests
Date Wed, 12 Nov 2014 12:15:12 GMT
[#7704] ticket:662 Fixed tests


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

Branch: refs/heads/ib/7704
Commit: 2d8143b085d62d6101699c747f17e535ee3bbe1d
Parents: 6184868
Author: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Authored: Wed Oct 8 14:49:24 2014 +0300
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Wed Nov 12 10:27:04 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/auth.py           | 7 ++++---
 Allura/allura/tests/functional/test_auth.py | 8 ++++++--
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/2d8143b0/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index cec2b28..c66b12e 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -261,9 +261,10 @@ class AuthController(BaseController):
             flash('Email address confirmed')
             h.auditlog_user('Email address verified: %s',  addr.email, user=addr.claimed_by_user())
 
-            if addr.claimed_by_user.pending:
-                addr.claimed_by_user.pending = False
-                addr.claimed_by_user.m.save()
+            user = addr.claimed_by_user()
+            if user.pending:
+                user.pending = False
+                user.m.save()
         else:
             flash('Unknown verification link', 'error')
 

http://git-wip-us.apache.org/repos/asf/allura/blob/2d8143b0/Allura/allura/tests/functional/test_auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_auth.py b/Allura/allura/tests/functional/test_auth.py
index 4a2b52b..3a50b7c 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -550,11 +550,13 @@ class TestAuth(TestController):
                               email='test@example.com'))
         assert 'That username is already taken. Please choose another.' in r
         r = self.app.get('/auth/logout')
+        user = M.User.query.get(username='aaa')
+        assert user.pending
+        user.pending = False
+        session(user).flush(user)
         r = self.app.post('/auth/do_login',
                           params=dict(username='aaa', password='12345678'),
                           status=302)
-        user = M.User.query.get(username='aaa')
-        assert user.pending
 
     def test_create_account_disabled_header_link(self):
         with h.push_config(config, **{'auth.allow_user_registration': 'false'}):
@@ -589,6 +591,8 @@ class TestAuth(TestController):
             display_name='Test Me',
             email='test@example.com')).follow()
         user = M.User.query.get(username='aaa')
+        user.pending = False
+        session(user).flush(user)
         assert M.ProjectRole.query.find(
             dict(user_id=user._id, project_id=p._id)).count() == 0
         self.app.get('/p/test/admin/permissions',


Mime
View raw message