Permalink
Browse files

Added test for rendering menu when on current page is a different root

  • Loading branch information...
1 parent 6bbbb13 commit 0a708ea0fa1599db71e7850d168b7741b6b592ae @spookylukey committed Jan 17, 2012
Showing with 25 additions and 0 deletions.
  1. +25 −0 fiber/tests.py
View
@@ -447,6 +447,31 @@ def test_show_user_menu_min_max_level(self):
'</li>'
'</ul>'))
+ def test_show_user_menu_different_root(self):
+ """
+ Test that show_menu only shows top level if current
+ page is in different root.
+ """
+ self.generate_data()
+ other_root = Page.objects.create(title='other')
+
+ t = Template("""
+ {% load fiber_tags %}
+ {% show_menu 'main' 1 999 %}
+ """
+ )
+ c = Context({
+ 'user': self.get_non_staff_user(),
+ 'fiber_page': other_root,
+ })
+ self.assertEquals(
+ strip_whitespace(t.render(c)),
+ ('<ul>'
+ '<li class="home first last">'
+ '<a href="/">home</a>'
+ '</li>'
+ '</ul>'))
+
def test_show_admin_menu_all(self):
self.generate_data()

0 comments on commit 0a708ea

Please sign in to comment.