-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add constance settings for password validation
- Loading branch information
1 parent
2c3841f
commit 97b92c1
Showing
4 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Source: https://lukeplant.me.uk/blog/posts/fuzzy-testing-with-assertnumqueries/ | ||
class FuzzyInt(int): | ||
def __new__(cls, lowest: int, highest: int): | ||
obj = super(FuzzyInt, cls).__new__(cls, highest) | ||
obj.lowest = lowest | ||
obj.highest = highest | ||
return obj | ||
|
||
def __eq__(self, other): | ||
return other >= self.lowest and other <= self.highest | ||
|
||
def __repr__(self): | ||
return "[%d..%d]" % (self.lowest, self.highest) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters