On Wed, 02 Dec 2009 15:18:13 -0000
Curtis Hovey <email address hidden> wrote:
...
> > Should there also be a test to show that the
> > MilestoneInlineNavigationMenu is chosen for MilestoneView, or is that
> > going too far?
>
> Yes, I think there should given that I botched the ZCML registration the
> first time.
>
Cool, and it looks good.
> === modified file 'lib/lp/registry/browser/tests/milestone-views.txt'
> --- lib/lp/registry/browser/tests/milestone-views.txt 2009-12-01 18:31:10 +0000
> +++ lib/lp/registry/browser/tests/milestone-views.txt 2009-12-02 15:14:33 +0000
> @@ -34,6 +34,15 @@
> >>> check_menu_links(MilestoneInlineNavigationMenu(milestone))
> True
>
> +The MilestoneView used can be adapted to a MilestoneInlineNavigationMenu
> +for use with inline presentation of milestones.
> +
> + >>> from canonical.lazr.canonicalurl import nearest_adapter
> + >>> from canonical.launchpad.webapp.interfaces import INavigationMenu
> +
> + >>> view = create_view(milestone, name='+productseries-table-row')
> + >>> nearest_adapter(view, INavigationMenu, name='overview')
> + <lp.registry.browser.milestone.MilestoneInlineNavigationMenu ...>
>
> The MilestoneView provides access to the milestone and to its release if
> it has one.
On Wed, 02 Dec 2009 15:18:13 -0000
Curtis Hovey <email address hidden> wrote:
... NavigationMenu is chosen for MilestoneView, or is that
> > Should there also be a test to show that the
> > MilestoneInline
> > going too far?
>
> Yes, I think there should given that I botched the ZCML registration the
> first time.
>
Cool, and it looks good.
> === modified file 'lib/lp/ registry/ browser/ tests/milestone -views. txt' registry/ browser/ tests/milestone -views. txt 2009-12-01 18:31:10 +0000 registry/ browser/ tests/milestone -views. txt 2009-12-02 15:14:33 +0000 links(Milestone InlineNavigatio nMenu(milestone )) NavigationMenu lazr.canonicalu rl import nearest_adapter launchpad. webapp. interfaces import INavigationMenu view(milestone, name='+ productseries- table-row' ) adapter( view, INavigationMenu, name='overview') browser. milestone. MilestoneInline NavigationMenu ...>
> --- lib/lp/
> +++ lib/lp/
> @@ -34,6 +34,15 @@
> >>> check_menu_
> True
>
> +The MilestoneView used can be adapted to a MilestoneInline
> +for use with inline presentation of milestones.
> +
> + >>> from canonical.
> + >>> from canonical.
> +
> + >>> view = create_
> + >>> nearest_
> + <lp.registry.
>
> The MilestoneView provides access to the milestone and to its release if
> it has one.