Permalink
Browse files

added urls for tests

  • Loading branch information...
1 parent b8148b5 commit 3149ed7d9f62e3164516bad911df08e5eb9fd6bb @fivethreeo fivethreeo committed Jan 25, 2011
Showing with 41 additions and 0 deletions.
  1. +25 −0 tests/testapp/second_cms_urls_for_apphook_tests.py
  2. +16 −0 tests/testapp/second_urls_for_apphook_tests.py
@@ -0,0 +1,25 @@
+from cms.apphook_pool import apphook_pool
+from cms.views import details
+from django.conf import settings
+from django.conf.urls.defaults import url, patterns
+
+if settings.APPEND_SLASH:
+ reg = url(r'^(?P<slug>[0-9A-Za-z-_.//]+)/$', details, name='pages-details-by-slug')
+else:
+ reg = url(r'^(?P<slug>[0-9A-Za-z-_.//]+)$', details, name='pages-details-by-slug')
+
+urlpatterns = [
+ # Public pages
+ url(r'^$', details, {'slug':''}, name='pages-root'),
+ reg,
+]
+
+if apphook_pool.get_apphooks():
+ """If there are some application urls, add special resolver, so we will
+ have standard reverse support.
+ """
+ from cms.appresolver import get_app_patterns
+ urlpatterns = get_app_patterns() + urlpatterns
+ #urlpatterns = (dynamic_app_regex_url_resolver, ) + urlpatterns
+
+urlpatterns = patterns('', *urlpatterns)
@@ -0,0 +1,16 @@
+from django.conf import settings
+from django.conf.urls.defaults import handler500, handler404, patterns, include, \
+ url
+from django.contrib import admin
+
+admin.autodiscover()
+
+urlpatterns = patterns('',
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),
+ url(r'^media/cms/(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root': settings.CMS_MEDIA_ROOT, 'show_indexes': True}),
+ url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
+ {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
+ url(r'^', include('testapp.second_cms_urls_for_apphook_tests')),
+)

0 comments on commit 3149ed7

Please sign in to comment.