allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#7903] ticket:818 Mention small letters in username validation error
Date Thu, 09 Jul 2015 21:33:57 GMT
Repository: allura
Updated Branches:
  refs/heads/master 5b29187b7 -> 338f454a9


[#7903] ticket:818 Mention small letters in username validation error


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

Branch: refs/heads/master
Commit: 338f454a951a50beae137776625987e5a6c1e84b
Parents: 5b29187
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Wed Jul 8 13:47:16 2015 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Jul 9 21:33:40 2015 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/forms.py                  | 4 ++--
 Allura/allura/tests/functional/test_auth.py         | 7 +++++--
 Allura/allura/tests/functional/test_neighborhood.py | 6 +++---
 3 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/338f454a/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index f523208..cfbad2c 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -56,7 +56,7 @@ class NeighborhoodProjectShortNameValidator(fev.FancyValidator):
     def _validate_shortname(self, shortname, neighborhood, state):
         if not h.re_project_name.match(shortname):
             raise forge_exc.ProjectShortnameInvalid(
-                'Please use only letters, numbers, and dashes 3-15 characters long.',
+                'Please use only small letters, numbers, and dashes 3-15 characters long.',
                 shortname, state)
 
     def _validate_allowed(self, shortname, neighborhood, state):
@@ -747,7 +747,7 @@ class RegistrationForm(ForgeForm):
             validator=fev.Regex(
                 h.re_project_name))
         username.validator._messages['invalid'] = (
-            'Usernames must include only letters, numbers, and dashes.'
+            'Usernames must include only small letters, numbers, and dashes.'
             ' They must also start with a letter and be at least 3 characters'
             ' long.')
         fields = [

http://git-wip-us.apache.org/repos/asf/allura/blob/338f454a/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 4522dd8..388be1a 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -670,9 +670,12 @@ class TestAuth(TestController):
         r = self.app.get('/auth/create_account')
         assert 'Create an Account' in r
         r = self.app.post('/auth/save_new',
-                          params=dict(username='aaa', pw='123',
+                          params=dict(username='AAA', pw='123',
                                       _session_id=self.app.cookies['_session_id']))
-        assert 'Enter a value 6 characters long or more' in r
+        assert_in('Enter a value 6 characters long or more', r)
+        assert_in('Usernames must include only small letters, numbers, '
+                  'and dashes. They must also start with a letter and be '
+                  'at least 3 characters long.', r)
         r = self.app.post(
             '/auth/save_new',
             params=dict(

http://git-wip-us.apache.org/repos/asf/allura/blob/338f454a/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index 5d0d3ac..f87e9ea 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -509,7 +509,7 @@ class TestNeighborhood(TestController):
                           antispam=True,
                           extra_environ=dict(username='root'))
         assert r.html.find('div', {'class': 'error'}
-                           ).string == 'Please use only letters, numbers, and dashes 3-15
characters long.'
+                           ).string == 'Please use only small letters, numbers, and dashes
3-15 characters long.'
         r = self.app.post('/adobe/register',
                           params=dict(
                               project_unixname='mymoz', project_name='My Moz',
@@ -524,7 +524,7 @@ class TestNeighborhood(TestController):
                           antispam=True,
                           extra_environ=dict(username='root'))
         assert r.html.find('div', {'class': 'error'}
-                           ).string == 'Please use only letters, numbers, and dashes 3-15
characters long.'
+                           ).string == 'Please use only small letters, numbers, and dashes
3-15 characters long.'
         r = self.app.post('/p/register',
                           params=dict(
                               project_unixname='test', project_name='Tester',
@@ -834,7 +834,7 @@ class TestNeighborhood(TestController):
             r = self.app.get(
                 '/p/check_names?neighborhood=Projects&project_unixname=%s' % name)
             assert_equal(
-                r.json, {'project_unixname': 'Please use only letters, numbers, and dashes
3-15 characters long.'})
+                r.json, {'project_unixname': 'Please use only small letters, numbers, and
dashes 3-15 characters long.'})
         r = self.app.get(
             '/p/check_names?neighborhood=Projects&project_unixname=mymoz')
         assert_equal(r.json, {})


Mime
View raw message