Ejemplo n.º 1
0
 def test_success(self):
     data = {
         'new_password1': 'Chah+pher9k',
         'new_password2': 'Chah+pher9k',
         }
     form = PasswordPoliciesForm(self.user, data)
     self.assertTrue(form.is_valid())
 def test_password_mismatch(self):
     data = {'new_password1': 'Chah+pher9k',
             'new_password2': 'Chah+pher8k'}
     form = PasswordPoliciesForm(self.user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form["new_password2"].errors,
                      [force_text(form.error_messages['password_mismatch'])])
 def test_reused_password(self):
     data = {'new_password1': 'ooDei1Hoo+Ru',
             'new_password2': 'ooDei1Hoo+Ru'}
     form = PasswordPoliciesForm(self.user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form["new_password1"].errors,
                      [force_unicode(form.error_messages['password_used'])])
 def test_password_verification_unicode(self):
     password = u'\xc1\u20ac\xc3\xc4\u0662\xc5\xc6\xc7'
     self.assertEqual(len(password), 8)
     data = {'new_password1': password,
             'new_password2': password}
     form = PasswordPoliciesForm(self.user, data)
     self.assertTrue(form.is_valid())
 def test_password_mismatch(self):
     data = {'new_password1': 'Chah+pher9k',
             'new_password2': 'Chah+pher8k'}
     form = PasswordPoliciesForm(self.user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form["new_password2"].errors,
                      [force_unicode(form.error_messages['password_mismatch'])])
 def test_password_verification_unicode(self):
     password = u'\xc1\u20ac\xc3\xc4\u0662\xc5\xc6\xc7'
     self.assertEqual(len(password), 8)
     data = {'new_password1': password,
             'new_password2': password}
     form = PasswordPoliciesForm(self.user, data)
     self.assertTrue(form.is_valid())
 def test_reused_password(self):
     data = {'new_password1': 'ooDei1Hoo+Ru',
             'new_password2': 'ooDei1Hoo+Ru'}
     form = PasswordPoliciesForm(self.user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form["new_password1"].errors,
                      [force_text(form.error_messages['password_used'])])
Ejemplo n.º 8
0
 def test_success(self):
     user = User.objects.get(username='******')
     data = {
         'new_password1': 'Chah+pher9k',
         'new_password2': 'Chah+pher9k',
         }
     form = PasswordPoliciesForm(user, data)
     self.assertTrue(form.is_valid())
 def test_password_mismatch(self):
     data = {"new_password1": "Chah+pher9k", "new_password2": "Chah+pher8k"}
     form = PasswordPoliciesForm(self.user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(
         form["new_password2"].errors,
         [force_text(form.error_messages["password_mismatch"])],
     )
 def test_reused_password(self):
     data = {"new_password1": "ooDei1Hoo+Ru", "new_password2": "ooDei1Hoo+Ru"}
     form = PasswordPoliciesForm(self.user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(
         form["new_password1"].errors,
         [force_text(form.error_messages["password_used"])],
     )
Ejemplo n.º 11
0
 def test_success(self):
     user = User.objects.get(username='******')
     data = {
         'new_password1': 'Chah+pher9k',
         'new_password2': 'Chah+pher9k',
     }
     form = PasswordPoliciesForm(user, data)
     self.assertTrue(form.is_valid())
Ejemplo n.º 12
0
 def test_password_verification_unicode(self):
     user = User.objects.get(username='******')
     password = u'\xc1\u20ac\xc3\xc4\u0662\xc5\xc6\xc7'
     self.assertEqual(len(password), 8)
     data = {
         'new_password1': password,
         'new_password2': password,
     }
     form = PasswordPoliciesForm(user, data)
     self.assertTrue(form.is_valid())
Ejemplo n.º 13
0
 def test_reused_password(self):
     user = User.objects.get(username='******')
     data = {
         'new_password1': 'K9hrfQH!zdj',
         'new_password2': 'K9hrfQH!zdj',
     }
     form = PasswordPoliciesForm(user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form["new_password1"].errors,
                      [force_unicode(form.error_messages['password_used'])])
Ejemplo n.º 14
0
 def test_reused_password(self):
     user = User.objects.get(username='******')
     data = {
         'new_password1': 'K9hrfQH!zdj',
         'new_password2': 'K9hrfQH!zdj',
         }
     form = PasswordPoliciesForm(user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form["new_password1"].errors,
                      [force_unicode(form.error_messages['password_used'])])
Ejemplo n.º 15
0
 def test_password_mismatch(self):
     user = User.objects.get(username='******')
     data = {
         'new_password1': 'Chah+pher9k',
         'new_password2': 'Chah+pher8k',
         }
     form = PasswordPoliciesForm(user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(form["new_password2"].errors,
                      [force_unicode(form.error_messages['password_mismatch'])])
Ejemplo n.º 16
0
 def test_password_verification_unicode(self):
     user = User.objects.get(username='******')
     password = u'\xc1\u20ac\xc3\xc4\u0662\xc5\xc6\xc7'
     self.assertEqual(len(password), 8)
     data = {
         'new_password1': password,
         'new_password2': password,
         }
     form = PasswordPoliciesForm(user, data)
     self.assertTrue(form.is_valid())
Ejemplo n.º 17
0
 def test_password_mismatch(self):
     user = User.objects.get(username='******')
     data = {
         'new_password1': 'Chah+pher9k',
         'new_password2': 'Chah+pher8k',
     }
     form = PasswordPoliciesForm(user, data)
     self.assertFalse(form.is_valid())
     self.assertEqual(
         form["new_password2"].errors,
         [force_unicode(form.error_messages['password_mismatch'])])
 def test_success(self):
     data = {"new_password1": "Chah+pher9k", "new_password2": "Chah+pher9k"}
     form = PasswordPoliciesForm(self.user, data)
     self.assertTrue(form.is_valid())
 def test_success(self):
     data = {'new_password1': 'Chah+pher9k',
             'new_password2': 'Chah+pher9k'}
     form = PasswordPoliciesForm(self.user, data)
     self.assertTrue(form.is_valid())