Skip to content

Commit 102af1c

Browse files
committed
remove deprecated non-integer input to randrange()
Replace float division with integer division in `create_user()` to ensure integer input to `randint()`, which internally calls `randrange()`. Non-integer inputs to `randrange()` has been deprecated in Python 3.10, and will be removed in a future version. This change also addresses the corresponding python warnings that would appear in the client code that uses the `create_user()` method.
1 parent fb35294 commit 102af1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

password_policies/tests/lib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def create_user(
4646
if not raw_password:
4747
raw_password = passwords[-1]
4848
if not date_joined:
49-
rind = randint(0, (duration / count + 1))
49+
rind = randint(0, (duration // count + 1))
5050
seconds = (count * duration + rind) * 2
5151
date_joined = get_datetime_from_delta(timezone.now(), seconds)
5252
if not last_login:

0 commit comments

Comments
 (0)