matchers#
BaseMatcher#
Bases: ABC
Base Matcher class.
If type is supplied and is not None, checks that matched object is an instance of type.
All subclasses should implement the match method.
Source code in tests/utils/matchers.py
__repr__()
#
Print class name and matcher arguments.
Source code in tests/utils/matchers.py
AnyMatcher#
LengthMatcher#
Bases: BaseMatcher
Match any object with len(obj) matching specified length.
Source code in tests/utils/matchers.py
ListMatcher#
BaseValidatorMatcher#
Bases: BaseMatcher
Validator that checks matches using a Django validator.
Source code in tests/utils/matchers.py
RegexMatcher#
URLMatcher#
Bases: BaseValidatorMatcher
Match URLs using Django URLValidator.
Note that the validator requires URL to have a domain, so e.g. "https://host/path" will not match.
Source code in tests/utils/matchers.py
DateTimeStrMatcher#
DateTimeMatcher#
DictContainingMatcher#
Bases: BaseMatcher
Match dicts that contain all keys and values from partial_dict.