- self.assertQueryLimit(1, (fifth, 'sub/path/tail/len/five'), 'root/second/third/fourth/fifth/sub/path/tail/len/five', absolute_result=False)
\ No newline at end of file
+ self.assertQueryLimit(1, (fifth, 'sub/path/tail/len/five'), 'root/second/third/fourth/fifth/sub/path/tail/len/five', absolute_result=False)
+
+ def test_get_path(self):
+ root = Node.objects.get(slug='root')
+ root2 = Node.objects.get(slug='root')
+ third = Node.objects.get(slug='third')
+ second2 = Node.objects.get(slug='second2')
+ fifth = Node.objects.get(slug='fifth')
+ e = AncestorDoesNotExist
+
+ self.assertQueryLimit(0, 'root', callable=root.get_path)
+ self.assertQueryLimit(0, '', root2, callable=root.get_path)
+ self.assertQueryLimit(1, 'root/second/third', callable=third.get_path)
+ self.assertQueryLimit(1, 'second/third', root, callable=third.get_path)
+ self.assertQueryLimit(1, e, third, callable=second2.get_path)
+ self.assertQueryLimit(1, '? - ?', root, ' - ', 'title', callable=third.get_path)
\ No newline at end of file