← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:fix-sprint-timebombs into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:fix-sprint-timebombs into launchpad:master.

Commit message:
Fix a test broken by sprint timebomb fixes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/413865

This minimally fixes `xx-pillar-sprints.txt` to cope with changes in https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/413755.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:fix-sprint-timebombs into launchpad:master.
diff --git a/lib/lp/registry/stories/pillar/xx-pillar-sprints.txt b/lib/lp/registry/stories/pillar/xx-pillar-sprints.txt
index a9d744d..7526c99 100644
--- a/lib/lp/registry/stories/pillar/xx-pillar-sprints.txt
+++ b/lib/lp/registry/stories/pillar/xx-pillar-sprints.txt
@@ -4,13 +4,34 @@ Sprints relevant for pillars
 For Products, ProjectGroups and Distributions, we have a +sprints page which
 lists all events relevant to that pillar.
 
+    >>> from datetime import (
+    ...     datetime,
+    ...     timedelta,
+    ...     )
     >>> import re
+    >>> import pytz
+    >>> from zope.component import getUtility
+    >>> from lp.registry.interfaces.distribution import IDistributionSet
+    >>> from lp.registry.interfaces.product import IProductSet
+
     >>> def print_sprints(contents):
     ...     maincontent = find_tag_by_id(contents, 'maincontent')
     ...     for link in maincontent.find_all('a'):
     ...         if re.search('/sprints/[a-z0-9]', link['href']) is not None:
     ...             print(link.decode_contents())
 
+    >>> login('test@xxxxxxxxxxxxx')
+    >>> futurista = factory.makeSprint(
+    ...     name='futurista', title='Future Mega Meeting',
+    ...     time_starts=datetime.now(pytz.UTC) + timedelta(days=1))
+    >>> firefox = getUtility(IProductSet).getByName('firefox')
+    >>> firefox_spec = firefox.specifications(futurista.owner)[0]
+    >>> _ = firefox_spec.linkSprint(futurista, futurista.owner)
+    >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
+    >>> ubuntu_spec = ubuntu.specifications(futurista.owner)[0]
+    >>> _ = ubuntu_spec.linkSprint(futurista, futurista.owner)
+    >>> logout()
+
     >>> anon_browser.open('http://launchpad.test/firefox/+sprints')
     >>> print_sprints(anon_browser.contents)
     Future Mega Meeting