Changeset - 18a3ca35d501
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 15 years ago 2010-11-23 22:33:59
marcin@python-works.com
fixed grammar in taken email error
3 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/forms.py
Show inline comments
 
@@ -261,13 +261,13 @@ def UniqSystemEmail(old_data):
 
            value = value.lower()
 
            if old_data.get('email') != value:
 
                sa = meta.Session()
 
                try:
 
                    user = sa.query(User).filter(User.email == value).scalar()
 
                    if user:
 
                        raise formencode.Invalid(_("That e-mail address is already taken") ,
 
                        raise formencode.Invalid(_("This e-mail address is already taken") ,
 
                                                 value, state)
 
                finally:
 
                    meta.Session.remove()
 

	
 
            return value
 

	
 
@@ -277,13 +277,13 @@ class ValidSystemEmail(formencode.valida
 
    def to_python(self, value, state):
 
        value = value.lower()
 
        sa = meta.Session
 
        try:
 
            user = sa.query(User).filter(User.email == value).scalar()
 
            if  user is None:
 
                raise formencode.Invalid(_("That e-mail address doesn't exist.") ,
 
                raise formencode.Invalid(_("This e-mail address doesn't exist.") ,
 
                                         value, state)
 
        finally:
 
            meta.Session.remove()
 

	
 
        return value
 

	
rhodecode/tests/functional/test_admin_settings.py
Show inline comments
 
@@ -94,13 +94,13 @@ class TestAdminSettingsController(TestCo
 
                                                            new_password='test12',
 
                                                            name='NewName',
 
                                                            lastname='NewLastname',
 
                                                            email=new_email,))
 
        print response
 

	
 
        assert 'That e-mail address is already taken' in response.body, 'Missing error message about existing email'
 
        assert 'This e-mail address is already taken' in response.body, 'Missing error message about existing email'
 

	
 

	
 
    def test_my_account_update_err(self):
 
        self.log_user('test_regular2', 'test12')
 

	
 
        new_email = 'newmail.pl'
rhodecode/tests/functional/test_login.py
Show inline comments
 
@@ -86,24 +86,24 @@ class TestLoginController(TestController
 
                                             'password_confirmation':'test12',
 
                                             'email':'test_admin@mail.com',
 
                                             'name':'test',
 
                                             'lastname':'test'})
 

	
 
        assert response.status == '200 OK', 'Wrong response from register page got %s' % response.status
 
        assert 'That e-mail address is already taken' in response.body
 
        assert 'This e-mail address is already taken' in response.body
 

	
 
    def test_register_err_same_email_case_sensitive(self):
 
        response = self.app.post(url(controller='login', action='register'),
 
                                            {'username':'test_admin_1',
 
                                             'password':'test12',
 
                                             'password_confirmation':'test12',
 
                                             'email':'TesT_Admin@mail.COM',
 
                                             'name':'test',
 
                                             'lastname':'test'})
 
        assert response.status == '200 OK', 'Wrong response from register page got %s' % response.status
 
        assert 'That e-mail address is already taken' in response.body
 
        assert 'This e-mail address is already taken' in response.body
 

	
 
    def test_register_err_wrong_data(self):
 
        response = self.app.post(url(controller='login', action='register'),
 
                                            {'username':'xs',
 
                                             'password':'test',
 
                                             'password_confirmation':'test',
 
@@ -197,13 +197,13 @@ class TestLoginController(TestController
 

	
 

	
 
    def test_forgot_password_wrong_mail(self):
 
        response = self.app.post(url(controller='login', action='password_reset'),
 
                                            {'email':'marcin@wrongmail.org', })
 

	
 
        assert "That e-mail address doesn't exist" in response.body, 'Missing error message about wrong email'
 
        assert "This e-mail address doesn't exist" in response.body, 'Missing error message about wrong email'
 

	
 
    def test_forgot_password(self):
 
        response = self.app.get(url(controller='login', action='password_reset'))
 
        assert response.status == '200 OK', 'Wrong response from login page got %s' % response.status
 

	
 
        username = 'test_password_reset_1'
0 comments (0 inline, 0 general)