summaryrefslogtreecommitdiff
path: root/django/test
diff options
context:
space:
mode:
authorДилян Палаузов <Dilyan.Palauzov@db.com>2017-12-27 00:14:12 +0530
committerTim Graham <timograham@gmail.com>2017-12-26 17:11:15 -0500
commit4c599ece57fa009cf3615f09497f81bfa6a585a7 (patch)
tree1f27a7e76024aaa5bc69356826061262d35d0be3 /django/test
parentc21f158295d92e35caf96436bfdbbff554fc5569 (diff)
Fixed #28930 -- Simplified code with any() and all().
Diffstat (limited to 'django/test')
-rw-r--r--django/test/utils.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/django/test/utils.py b/django/test/utils.py
index 1678bf0de4..c1c38ca096 100644
--- a/django/test/utils.py
+++ b/django/test/utils.py
@@ -553,10 +553,7 @@ def compare_xml(want, got):
got_children = children(got_element)
if len(want_children) != len(got_children):
return False
- for want, got in zip(want_children, got_children):
- if not check_element(want, got):
- return False
- return True
+ return all(check_element(want, got) for want, got in zip(want_children, got_children))
def first_node(document):
for node in document.childNodes: