Skip to content

Address pytest warnings #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 1, 2025
Prev Previous commit
Next Next commit
Add tests
  • Loading branch information
fayazkhan committed May 31, 2025
commit 2fbf03fdaac4d27483e462f399d254cd11797934
18 changes: 18 additions & 0 deletions sqlalchemy_mptt/tests/cases/get_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,24 @@ def go(id):
]
self.assertEqual(tree, reference_tree)

def test_drilldown_tree_without_session(self):
def go(id):
return get_obj(self.session, self.model, id)
node = go(7)
tree = node.drilldown_tree()
reference_tree = [
{'node': go(7),
'children': [
{'node': go(8),
'children': [
{'node': go(9)}]},
{'node': go(10),
'children': [
{'node': go(11)}]}]
}
]
self.assertEqual(tree, reference_tree)

def test_path_to_root(self):
r"""Generate path from a leaf or intermediate node to the root.

Expand Down