allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [06/26] git commit: [#7589] ticket:622 Test for User.index()
Date Fri, 19 Sep 2014 20:04:20 GMT
[#7589] ticket:622 Test for User.index()


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

Branch: refs/heads/master
Commit: 9103e2032b4731587a9e73404e880e752b041d04
Parents: 6c9a86d
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Aug 4 15:44:08 2014 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 19 19:35:38 2014 +0000

----------------------------------------------------------------------
 Allura/allura/tests/model/test_auth.py | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9103e203/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 9c5a74c..4660510 100644
--- a/Allura/allura/tests/model/test_auth.py
+++ b/Allura/allura/tests/model/test_auth.py
@@ -277,3 +277,39 @@ def test_user_track_active():
     c.user = M.User.by_username(c.user.username)
     assert_equal(c.user.last_access['session_ip'], 'new addr')
     assert_equal(c.user.last_access['session_ua'], 'new browser')
+
+
+@with_setup(setUp)
+def test_user_index():
+    c.user.email_addresses = ['email1', 'email2']
+    c.user.set_pref('email_address', 'email2')
+    idx = c.user.index()
+    assert_equal(idx['id'], c.user.index_id())
+    assert_equal(idx['title'], 'User test-admin')
+    assert_equal(idx['type_s'], 'User')
+    assert_equal(idx['username_s'], 'test-admin')
+    assert_equal(idx['email_addresses_t'], 'email1 email2')
+    assert_equal(idx['email_address_s'], 'email2')
+    assert_in('last_password_updated_dt', idx)
+    assert_equal(idx['disabled_b'], False)
+    assert_in('results_per_page_i', idx)
+    assert_in('email_format_s', idx)
+    assert_in('disable_user_messages_b', idx)
+    assert_equal(idx['display_name_s'], 'Test Admin')
+    assert_equal(idx['sex_s'], 'Unknown')
+    assert_in('birthdate_dt', idx)
+    assert_in('localization_s', idx)
+    assert_in('timezone_s', idx)
+    assert_in('socialnetworks_t', idx)
+    assert_in('telnumbers_t', idx)
+    assert_in('skypeaccount_s', idx)
+    assert_in('webpages_t', idx)
+    assert_in('skills_t', idx)
+    assert_in('last_access_login_date_dt', idx)
+    assert_in('last_access_login_ip_s', idx)
+    assert_in('last_access_login_ua_t', idx)
+    assert_in('last_access_session_date_dt', idx)
+    assert_in('last_access_session_ip_s', idx)
+    assert_in('last_access_session_ua_t', idx)
+    # provided bby auth provider
+    assert_in('user_registration_date_dt', idx)


Mime
View raw message