Skip to content

Commit

Permalink
test for #1296 (apphook urls breaking on home tree)
Browse files Browse the repository at this point in the history
  • Loading branch information
ojii committed Jun 15, 2012
1 parent 0161474 commit 6fa2770
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cms/tests/apphooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from __future__ import with_statement
from cms.api import create_page, create_title
from cms.apphook_pool import apphook_pool
from cms.appresolver import applications_page_check, clear_app_resolvers
from cms.appresolver import (applications_page_check, clear_app_resolvers,
get_app_patterns)
from cms.test_utils.testcases import CMSTestCase
from cms.test_utils.util.context_managers import SettingsOverride
from django.contrib.auth.models import User
Expand Down Expand Up @@ -135,3 +136,15 @@ def test_get_page_for_apphook(self):
self.assertContains(response, de_title.title)

apphook_pool.clear()

def test_apphook_breaking_under_home_with_new_path_caching(self):
with SettingsOverride(CMS_MODERATOR=False, CMS_PERMISSION=False):
home = create_page("home", "nav_playground.html", "en", published=True)
child = create_page("child", "nav_playground.html", "en", published=True, parent=home)
# not-home is what breaks stuff, because it contains the slug of the home page
not_home = create_page("not-home", "nav_playground.html", "en", published=True, parent=child)
create_page("subchild", "nav_playground.html", "en", published=True, parent=not_home, apphook='SampleApp')
urlpatterns = get_app_patterns()
resolver = urlpatterns[0]
url = resolver.reverse('sample-root')
self.assertEqual(url, 'child/not-home/subchild/')

0 comments on commit 6fa2770

Please sign in to comment.