Hi,

    I need a custom path for the index page,
so for the last couple of years I've used the patch from here:

    http://trac.edgewall.org/ticket/10595

At this point I would like to also write some tests for it,
hoping for an easier adoption, but I have no experience
writing tests like the ones used by this project.

Would you please help me with some pointers,
like which of the existing tests would be a good place to start from?

P.S. I have also attached the patch for the latest trunk.

Have a nice day,
  Eduard

--
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-dev.
For more options, visit https://groups.google.com/d/optout.
diff --git a/trac/wiki/web_ui.py b/trac/wiki/web_ui.py
--- a/trac/wiki/web_ui.py
+++ b/trac/wiki/web_ui.py
@@ -22,7 +22,7 @@
 from genshi.builder import tag

 from trac.attachment import AttachmentModule
-from trac.config import IntOption
+from trac.config import IntOption, Option
 from trac.core import *
 from trac.mimeview.api import IContentConverter, Mimeview
 from trac.perm import IPermissionPolicy, IPermissionRequestor
@@ -55,6 +55,9 @@
     max_size = IntOption('wiki', 'max_size', 262144,
         """Maximum allowed wiki page size in characters.""")

+    index_page = Option('wiki', 'index_page', 'TitleIndex',
+                        """Custom index page path.""")
+
     PAGE_TEMPLATES_PREFIX = 'PageTemplates/'
     DEFAULT_PAGE_TEMPLATE = 'DefaultPage'

@@ -722,7 +725,7 @@
     def _wiki_ctxtnav(self, req, page):
         """Add the normal wiki ctxtnav entries."""
         add_ctxtnav(req, _("Start Page"), req.href.wiki('WikiStart'))
-        add_ctxtnav(req, _("Index"), req.href.wiki('TitleIndex'))
+        add_ctxtnav(req, _("Index"), req.href.wiki(self.index_page))
         if page.exists:
             add_ctxtnav(req, _("History"), req.href.wiki(page.name,
                                                          action='history'))

Reply via email to