allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#6833] restore not_empty validation; expand test
Date Mon, 04 Nov 2013 21:53:31 GMT
Updated Branches:
  refs/heads/db/fix6833 [created] 586c77e6a


[#6833] restore not_empty validation; expand test


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

Branch: refs/heads/db/fix6833
Commit: 586c77e6a2b24177a0c8e73beeb2bb5f4a0f86b0
Parents: 619e09e
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Mon Nov 4 21:53:16 2013 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon Nov 4 21:53:16 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/forms.py          | 1 +
 Allura/allura/tests/functional/test_auth.py | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/586c77e6/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index 554750a..de90d39 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -333,6 +333,7 @@ class AddSocialNetworkForm(ForgeForm):
             ew.SingleSelectField(
                 name='socialnetwork',
                 label='Social network',
+                validator=fev.UnicodeString(not_empty=True),
                 options=[ew.Option(py_value=name, label=name)
                          for name in socialnetworks]),
             ew.TextField(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/586c77e6/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 c112e38..a945c1a 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -499,13 +499,20 @@ class TestPreferences(TestController):
         assert len(user.socialnetworks) == 1 and \
                {'socialnetwork':socialnetwork2, 'accounturl':accounturl2} in user.socialnetworks
 
-        #Add invalid social network account
+        #Add empty social network account
         r = self.app.post('/auth/user_info/contacts/add_social_network',
              params=dict(accounturl = accounturl, socialnetwork=''))
         user = M.User.query.get(username='test-admin')
         assert len(user.socialnetworks) == 1 and \
                {'socialnetwork':socialnetwork2, 'accounturl':accounturl2} in user.socialnetworks
 
+        #Add invalid social network account
+        r = self.app.post('/auth/user_info/contacts/add_social_network',
+             params=dict(accounturl = accounturl, socialnetwork='invalid'))
+        user = M.User.query.get(username='test-admin')
+        assert len(user.socialnetworks) == 1 and \
+               {'socialnetwork':socialnetwork2, 'accounturl':accounturl2} in user.socialnetworks
+
         #Add telephone number
         telnumber = '+3902123456'
         r = self.app.post('/auth/user_info/contacts/add_telnumber',


Mime
View raw message