~deadlight/canonical-identity-provider/merge-1-static

« back to all changes in this revision

Viewing changes to src/api/v10/tests/test_forms.py

  • Committer: Ubuntu One Auto Copilot
  • Author(s): Maximiliano Bertacchini
  • Date: 2019-10-16 14:09:30 UTC
  • mfrom: (1697.1.2 improve-password-validation-ascii)
  • Revision ID: otto-copilot@canonical.com-20191016140930-nl3sn8ghheg84jhk
Improve password placeholder and validation message to include the requirement of ascii encoding.

Merged from https://code.launchpad.net/~maxiberta/canonical-identity-provider/improve-password-validation-ascii/+merge/374104

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
from api.v10.forms import WebserviceCreateAccountForm
9
9
from identityprovider.tests.utils import SSOBaseTestCase
 
10
from identityprovider.validators import PASSWORD_ENCODING_ERROR
10
11
 
11
12
 
12
13
class WebServiceCreateAccountFormTestCase(SSOBaseTestCase):
16
17
                'remote_ip': '127.0.0.1'}
17
18
        form = WebserviceCreateAccountForm(data=data)
18
19
        self.assertFalse(form.is_valid())
19
 
        self.assertEqual(form.errors['password'][0],
20
 
                         'Invalid characters in password')
 
20
        self.assertEqual(form.errors['password'], [PASSWORD_ENCODING_ERROR])
21
21
 
22
22
    def test_default_platform(self):
23
23
        form = WebserviceCreateAccountForm()