コード例 #1
0
  def test_validate_strong_password(self):
    """Tests if password validation works correctly."""
    def assert_error(password):
      try:
        auth.validate_strong_password(password)
        self.fail("Expected a ValidationError")
      except ValidationError:
        pass  # expected

    assert_error(None)
    assert_error("")
    assert_error("foo")
    assert_error("123456789")
    assert_error("1234abcd")
    assert_error("1234ABCD")

    auth.validate_strong_password("1234ABcd")
コード例 #2
0
ファイル: test_auth.py プロジェクト: CAPTools/CAPCollector
    def test_validate_strong_password(self):
        """Tests if password validation works correctly."""

        def assert_error(password):
            try:
                auth.validate_strong_password(password)
                self.fail("Expected a ValidationError")
            except ValidationError:
                pass  # expected

        assert_error(None)
        assert_error("")
        assert_error("foo")
        assert_error("123456789")
        assert_error("1234abcd")
        assert_error("1234ABCD")

        auth.validate_strong_password("1234ABcd")
コード例 #3
0
ファイル: test_auth.py プロジェクト: CAPTools/CAPCollector
 def assert_error(password):
     try:
         auth.validate_strong_password(password)
         self.fail("Expected a ValidationError")
     except ValidationError:
         pass  # expected
コード例 #4
0
ファイル: admin.py プロジェクト: mehshad/CAPCollector
 def clean_password1(self):
     password = self.cleaned_data["password1"]
     return auth.validate_strong_password(password)
コード例 #5
0
ファイル: admin.py プロジェクト: CAPTools/CAPCollector
 def clean_password1(self):
   password = self.cleaned_data["password1"]
   return auth.validate_strong_password(password)
コード例 #6
0
 def assert_error(password):
   try:
     auth.validate_strong_password(password)
     self.fail("Expected a ValidationError")
   except ValidationError:
     pass  # expected