Merge ~cjwatson/launchpad:fix-announcement-doctest into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 27f6e46f31f25ccebbe56a372a66c7c7f8e7b2c5
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-announcement-doctest
Merge into: launchpad:master
Diff against target: 24 lines (+5/-1)
1 file modified
lib/lp/registry/stories/announcements/xx-announcements.txt (+5/-1)
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+413504@code.launchpad.net

Commit message

Fix hardcoded future date in doctest

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Self-approving (trivial test-only fix).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/registry/stories/announcements/xx-announcements.txt b/lib/lp/registry/stories/announcements/xx-announcements.txt
2index a1a704c..8623b80 100644
3--- a/lib/lp/registry/stories/announcements/xx-announcements.txt
4+++ b/lib/lp/registry/stories/announcements/xx-announcements.txt
5@@ -6,6 +6,10 @@ list is available as a portlet on the project home page, as well as on a
6 dedicated batched page showing all announcements, and as an RSS/Atom
7 news feed.
8
9+ >>> from datetime import (
10+ ... datetime,
11+ ... timedelta,
12+ ... )
13 >>> import feedparser
14 >>> from lp.services.beautifulsoup import (
15 ... BeautifulSoup,
16@@ -202,7 +206,7 @@ date in the future when the announcement will be made:
17 >>> priv_browser.getControl('specific date and time').click()
18 >>> priv_browser.getControl(
19 ... name='field.publication_date.announcement_date').value = (
20- ... '2021-12-24 09:00:00')
21+ ... datetime.now() + timedelta(days=1)).isoformat()
22 >>> priv_browser.getControl('Make announcement').click()
23 >>> print(priv_browser.title)
24 Jokosher in Launchpad

Subscribers

People subscribed via source and target branches

to status/vote changes: