Author: batiste.bieler
Date: Sun May 10 08:19:17 2009
New Revision: 523

Modified:
    trunk/pages/tests.py
    trunk/pages/views.py

Log:
Fix issue 97

Modified: trunk/pages/tests.py
==============================================================================
--- trunk/pages/tests.py        (original)
+++ trunk/pages/tests.py        Sun May 10 08:19:17 2009
@@ -654,6 +654,28 @@
          page1.save()

          page1.get_calculated_status()
+        setattr(settings, "PAGE_SHOW_START_DATE", False)
+
+    def test_23_slug_bug(self):
+        """
+        Test the issue 97
+        http://code.google.com/p/django-page-cms/issues/detail?id=97
+        """
+        c = Client()
+        c.login(username= 'batiste', password='b')
+        page_data = self.get_new_page_data()
+        page_data['slug'] = 'page1'
+        # create a page for the example otherwise you will get a Http404  
error
+        response = c.post('/admin/pages/page/add/', page_data)
+
+        response = c.get('/pages/page1/')
+        self.assertEqual(response.status_code, 200)
+
+        try:
+            response = c.get('/pages/toto/page1/')
+        except TemplateDoesNotExist, e:
+            if e.args != ('404.html',):
+                raise

      def assertOnlyContextException(self, view):
          """

Modified: trunk/pages/views.py
==============================================================================
--- trunk/pages/views.py        (original)
+++ trunk/pages/views.py        Sun May 10 08:19:17 2009
@@ -31,6 +31,8 @@

      if slug:
          current_page = get_page_from_slug(slug, request, lang)
+        """if request.META['PATH_INFO'] != current_page.get_absolute_url():
+            raise Http404"""
      elif pages:
          current_page = pages[0]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to