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 2015/07/08 15:28:02 UTC
allura git commit: [#7903] ticket:818 Mention small letters in
username validation error
Repository: allura
Updated Branches:
refs/heads/ib/7903 [created] 426184bd0
[#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/426184bd
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/426184bd
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/426184bd
Branch: refs/heads/ib/7903
Commit: 426184bd0b14fb1d029f44fc203660f181a00d97
Parents: 93a1ecc
Author: Igor Bondarenko <je...@gmail.com>
Authored: Wed Jul 8 13:47:16 2015 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Wed Jul 8 15:56:01 2015 +0300
----------------------------------------------------------------------
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/426184bd/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/426184bd/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/426184bd/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 593671d..3f4663f 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, {})