Skip to content

Commit 8468fbd

Browse files
Greg KluparGreg Klupar
authored andcommitted
Amend last commit to get 100% coverage.
1 parent de0950b commit 8468fbd

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

sqlalchemy_mptt/tests/cases/integrity.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,7 @@ def test_hierarchy_structure(self):
9797
while nodes with left > self and right < self are considered descendants
9898
"""
9999
table = self.model
100-
tree_size = self.session.query(table).count()
101-
102-
pivot_idx = tree_size // 2
103-
pivot = self.session.query(table).slice(pivot_idx, pivot_idx+1).one()
100+
pivot = self.session.query(table).filter(table.right - table.left != 1).filter(table.parent_id != None).first()
104101

105102
# Exclusive Tests
106103
ancestors = self.session.query(table).filter(table.is_ancestor_of(pivot)).all()

0 commit comments

Comments
 (0)