Skip to content

Commit

Permalink
verson 20200502.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed May 3, 2020
1 parent bc2255d commit 0f06016
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pydal/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "20200502.1"
__version__ = "20200502.2"

from .base import DAL
from .objects import Field
Expand Down
4 changes: 2 additions & 2 deletions pydal/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -4455,7 +4455,7 @@ def validate(self, value, record_id=None):
numberset = frozenset(b"0123456789")
sym1set = frozenset(b"!@#$%^&*() ")
sym2set = frozenset(b"~`-_=+[]{}\\|;:'\",.<>?/")
otherset = frozenset(b"".join(chr(x) if PY2 else chr(r).encode() for x in range(256)))
otherset = frozenset(b"".join(chr(x) if PY2 else chr(x).encode() for x in range(256)))


def calc_entropy(string):
Expand Down Expand Up @@ -4515,7 +4515,7 @@ class IS_STRONG(Validator):
>>> IS_STRONG(es=True, entropy=100)('a1d')
('a1d', 'Password too simple (15.97/100)')
>>> IS_STRONG(es=True, entropy=100)('añd')
('a\\xc3\\xb1d', 'Password too simple (18.13/100)')
('a\\xc3\\xb1d', 'Password too simple (31.26/10)')
"""

Expand Down
4 changes: 2 additions & 2 deletions tests/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,10 +1058,10 @@ def test_IS_STRONG(self):
rtn = IS_STRONG(es=True, entropy=100)("añd")
if PY2:
self.assertEqual(
rtn, ("a\xc3\xb1d", "Password too simple (18.13/100)")
rtn, ("a\xc3\xb1d", "Password too simple (32.66/100)")
)
else:
self.assertEqual(rtn, ("añd", "Password too simple (18.13/100)"))
self.assertEqual(rtn, ("añd", "Password too simple (31.26/10)"))
rtn = IS_STRONG()("********")
self.assertEqual(rtn, ("********", None))
rtn = IS_STRONG(es=True, max=4)("abcde")
Expand Down

0 comments on commit 0f06016

Please sign in to comment.