Example #1
0
 def test_password_error_with_unspecified_characters(self):
     """
     validator.password_error()のテスト。
     指定外の文字を含む場合に適切なメッセージを返すかどうか。
     """
     v = Validator()
     password = "******"
     expected = "Enter a valid password."
     actual = v.password_error(password)
     self.assertEqual(expected, actual)
Example #2
0
 def test_password_error_with_too_long(self):
     """
     validator.password_error()のテスト。
     128文字以上の場合に適切なメッセージを返すかどうか。
     """
     v = Validator()
     password = "******" * 10 + "techtecht"
     expected = "This password is too long. 128 characters max."
     actual = v.password_error(password)
     self.assertEqual(expected, actual)
Example #3
0
 def test_password_error_with_common_words(self):
     """
     validator.password_error()のテスト。
     禁止語句を含む場合に適切なメッセージを返すかどうか。
     """
     v = Validator()
     password = "******"
     expected = "This password is too common."
     actual = v.password_error(password)
     self.assertEqual(expected, actual)
Example #4
0
 def test_password_error_with_too_short(self):
     """
     validator.password_error()のテスト。
     7文字以下の場合に適切なメッセージを返すかどうか。
     """
     v = Validator()
     password = "******"
     expected = "This password is too short. 8 characters min."
     actual = v.password_error(password)
     self.assertEqual(expected, actual)