Skip to content

Commit

Permalink
Merge pull request #4752 from cclauss/indentity-is-not-equality
Browse files Browse the repository at this point in the history
In Python identity is not the same thing as equality
  • Loading branch information
amercader committed Apr 30, 2019
2 parents 3b2cbdb + e79ca87 commit 42da3ce
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -189,7 +189,7 @@ def redirect_to(*args, **kw):
_url = ''
skip_url_parsing = False
parse_url = kw.pop('parse_url', False)
if uargs and len(uargs) is 1 and isinstance(uargs[0], string_types) \
if uargs and len(uargs) == 1 and isinstance(uargs[0], string_types) \
and (uargs[0].startswith('/') or is_url(uargs[0])) \
and parse_url is False:
skip_url_parsing = True
Expand Down
2 changes: 1 addition & 1 deletion ckan/plugins/toolkit.py
Expand Up @@ -475,7 +475,7 @@ def _get_endpoint(cls):
# there are some routes('hello_world') that are not using blueprint
# For such case, let's assume that view function is a controller
# itself and action is None.
if len(endpoint) is 1:
if len(endpoint) == 1:
return endpoint + (None,)
return endpoint

Expand Down
2 changes: 1 addition & 1 deletion ckan/tests/legacy/functional/test_pagination.py
Expand Up @@ -10,7 +10,7 @@

def scrape_search_results(response, object_type):
assert object_type in ('dataset', 'group_dataset', 'group', 'user')
if object_type is not 'group_dataset':
if object_type != 'group_dataset':
results = re.findall('a href="/%s/%s_(\d\d)' % (object_type, object_type),
str(response))
else:
Expand Down
2 changes: 1 addition & 1 deletion ckan/tests/legacy/logic/test_action.py
Expand Up @@ -702,7 +702,7 @@ def test_42_resource_search_test_percentage_is_escaped(self):
# There shouldn't be any results. If the '%' character wasn't
# escaped correctly, then the search would match because of the
# unescaped wildcard.
assert count is 0
assert count == 0

def test_42_resource_search_fields_parameter_still_accepted(self):
'''The fields parameter is deprecated, but check it still works.
Expand Down

0 comments on commit 42da3ce

Please sign in to comment.