def test_hash(self, create_mock): field = ChallengeField('md5') field._hash('message', b'salt') create_mock.assert_called_with('message', hashlib.md5, salt=b'salt')
def test_to_python_str(self): field = ChallengeField('md5') field._hash = MagicMock() field.to_python(None, 'message') field._hash.assert_called_with('message')