Skip to content

Commit

Permalink
Add test cases that fail when using _default_manager and objects #369
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaoming committed Apr 22, 2015
1 parent 1ba4928 commit 2b47ffd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/myapp/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,8 @@ def test_move_root_to_child(self):

class ManagerTests(TreeTestCase):
fixtures = ['categories.json',
'genres.json']
'genres.json',
'persons.json']

def test_all_managers_are_different(self):
# all tree managers should be different. otherwise, possible infinite recursion.
Expand Down Expand Up @@ -1234,8 +1235,11 @@ def test_custom_querysets(self):
"""
Test that a custom manager also provides custom querysets.
"""

self.assertTrue(isinstance(Person.objects.all(), CustomTreeQueryset))
self.assertTrue(isinstance(Person.objects.all()[0].get_children(), CustomTreeQueryset))
self.assertTrue(isinstance(Person.objects.all()[0].get_children().none(), CustomTreeQueryset))
self.assertTrue(isinstance(Person.objects.none(), CustomTreeQueryset))
self.assertEqual(
type(Person.objects.all()),
type(Person.objects.root_nodes())
Expand Down

0 comments on commit 2b47ffd

Please sign in to comment.