Skip to content

Commit

Permalink
added a test for the descendants method on PageAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewschoen committed Jun 27, 2012
1 parent d0852ed commit 84f1212
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cms/tests/admin.py
Expand Up @@ -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):
Expand Down

0 comments on commit 84f1212

Please sign in to comment.