You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2012/09/21 22:18:33 UTC

[3/16] git commit: [#4445] Changed asserts in test_user to be more useful on failure

[#4445] Changed asserts in test_user to be more useful on failure

Signed-off-by: Cory Johns <jo...@geek.net>


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

Branch: refs/heads/master
Commit: 3eb1feb85a4b6d43c0119cef6edfa5a0581011b2
Parents: 3dee961
Author: Cory Johns <jo...@geek.net>
Authored: Fri Sep 21 16:47:59 2012 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Fri Sep 21 18:36:16 2012 +0000

----------------------------------------------------------------------
 Allura/allura/tests/model/test_auth.py |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3eb1feb8/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 f1238e7..f9ab925 100644
--- a/Allura/allura/tests/model/test_auth.py
+++ b/Allura/allura/tests/model/test_auth.py
@@ -2,7 +2,7 @@
 """
 Model tests for auth
 """
-from nose.tools import with_setup
+from nose.tools import with_setup, assert_equal
 from pylons import c, g
 from webob import Request
 
@@ -63,16 +63,16 @@ def test_openid():
 def test_user():
     assert c.user.url() .endswith('/u/test-admin/')
     assert c.user.script_name .endswith('/u/test-admin/')
-    assert set(p.shortname for p in c.user.my_projects()) == set(['test', 'test2', 'u/test-admin', 'adobe-1', '--init--'])
+    assert_equal(set(p.shortname for p in c.user.my_projects()), set(['test', 'test2', 'u/test-admin', 'adobe-1', '--init--']))
     # delete one of the projects and make sure it won't appear in my_projects()
     p = M.Project.query.get(shortname='test2')
     p.deleted = True
-    assert set(p.shortname for p in c.user.my_projects()) == set(['test', 'u/test-admin', 'adobe-1', '--init--'])
-    assert M.User.anonymous().project_role().name == '*anonymous'
+    assert_equal(set(p.shortname for p in c.user.my_projects()), set(['test', 'u/test-admin', 'adobe-1', '--init--']))
+    assert_equal(M.User.anonymous().project_role().name, '*anonymous')
     u = M.User.register(dict(
             username='nosetest-user'))
     ThreadLocalORMSession.flush_all()
-    assert u.private_project().shortname == 'u/nosetest-user'
+    assert_equal(u.private_project().shortname, 'u/nosetest-user')
     roles = g.credentials.user_roles(
         u._id, project_id=u.private_project().root_project._id)
     assert len(roles) == 3, roles