Skip to content

Commit

Permalink
Use is instead of == to compare to True/False in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Sep 27, 2024
1 parent 2d74945 commit 21904e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/unittests/general/util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def test_multi_mask_should_raise(self):
class TestFirstTrue(object):
def test_first_true_should_find_true_element(self):
elems = [False, False, True, False]
assert first_true(elems) == True
assert first_true(elems) is True

def test_first_true_should_return_default_value_when_no_true_found(self):
elems = [False, False, False]
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/general/webfront_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_authenticate_remote_user_should_return_false_if_account_locked(self):
):
with patch("nav.web.auth.LogEntry.add_log_entry"):
with patch("nav.web.auth.Account.locked", return_value=True):
assert remote_user.authenticate(request) == False
assert remote_user.authenticate(request) is False


class TestGetStandardUrls(object):
Expand Down

0 comments on commit 21904e0

Please sign in to comment.