Commits

Marius Gedminas committed 4c988ce

Make /_dozer work show the index page

Previously it used to cause

TypeError: getattr(): attribute name must be string

  • Participants
  • Parent commits 49ea904

Comments (0)

Files changed (3)

File CHANGELOG.rst

 
 0.4.1 (unreleased)
 ------------------
-* No changes yet.
+* Make /_dozer work show the index page (instead of an internal server
+  error).
 
 0.4 (March 21, 2013)
 --------------------

File dozer/leak.py

             return self.app(environ, start_response)
 
     def dowse(self, req):
-        next_part = req.path_info_pop()
+        next_part = req.path_info_pop() or 'index'
         method = getattr(self, next_part, None)
         if method is None:
             return exc.HTTPNotFound('Nothing could be found to match %r' % next_part)

File dozer/tests/test_leak.py

         resp = app.get('/')
         self.assertTrue('hello, world!' in resp)
 
+    def test_dozer(self):
+        app = self.make_test_app()
+        resp = app.get('/_dozer')
+        self.assertEqual(resp.status_int, 200)
+        self.assertTrue('<div id="output">' in resp)
+
     def test_dozer_index(self):
         app = self.make_test_app()
         resp = app.get('/_dozer/index')