Skip to content
Browse files

added a test for the descendants method on PageAdmin

  • Loading branch information...
1 parent d0852ed commit 84f1212d44a147f8bb6f4c985b05a6aa5e30c63a @andrewschoen andrewschoen committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 cms/tests/admin.py
View
10 cms/tests/admin.py
@@ -392,7 +392,15 @@ def test_changelist_tree(self):
response = client.get(url)
self.assertEquals(response.status_code, 200)
self.assertEquals(response.context["open_menu_trees"], [1,2])
-
+ # tests descendants method for the lazy load ajax call
+ url = "%s%d/descendants/" % (url, first_level_page.pk)
+ response = client.get(url)
+ self.assertEquals(response.status_code, 200)
+ # should include both direct descendant pages
+ self.assertTrue('id="page_2"' in response.content)
+ self.assertTrue('id="page_3"' in response.content)
+ # but not any further down the tree
+ self.assertFalse('id="page_4"' in response.content)
class AdminFieldsetTests(TestCase):

0 comments on commit 84f1212

Please sign in to comment.
Something went wrong with that request. Please try again.