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/10/15 12:56:17 UTC
[07/12] git commit: [#7704] ticket:662 Fixed tests
[#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/401e6389
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/401e6389
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/401e6389
Branch: refs/heads/je/42cc_7704
Commit: 401e63890f1006c86b31c9260576b0b3f772bccd
Parents: 1b700cc
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Wed Oct 8 14:49:24 2014 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Oct 15 11:24:55 2014 +0300
----------------------------------------------------------------------
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/401e6389/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 5900e82..7ea7c2a 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -268,9 +268,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/401e6389/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 7e5985b..058ae09 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -393,12 +393,14 @@ 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'}):
@@ -435,6 +437,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',