Merge lp:~allenap/launchpad/a-moment-ago-1 into lp:launchpad

Proposed by Gavin Panella
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: 14335
Proposed branch: lp:~allenap/launchpad/a-moment-ago-1
Merge into: lp:launchpad
Diff against target: 73 lines (+11/-13)
2 files modified
lib/lp/blueprints/browser/tests/test_specification.py (+3/-10)
lib/lp/code/browser/tests/test_branchlisting.py (+8/-3)
To merge this branch: bzr merge lp:~allenap/launchpad/a-moment-ago-1
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+82706@code.launchpad.net

Commit message

[r=bac][no-qa] Remove some more matches against "a moment ago" in tests because it might not be.

Description of the change

Remove some more matches against "a moment ago".

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

This is not all of them, but I have to get back to other things now.

Revision history for this message
Brad Crittenden (bac) wrote :

Thanks for the clean up Gavin

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/blueprints/browser/tests/test_specification.py'
2--- lib/lp/blueprints/browser/tests/test_specification.py 2011-10-23 00:55:30 +0000
3+++ lib/lp/blueprints/browser/tests/test_specification.py 2011-11-18 16:33:27 +0000
4@@ -8,10 +8,7 @@
5 import unittest
6
7 import pytz
8-from testtools.matchers import (
9- DocTestMatches,
10- Equals,
11- )
12+from testtools.matchers import Equals
13 from zope.component import getUtility
14 from zope.publisher.interfaces import NotFound
15 from zope.security.proxy import removeSecurityProxy
16@@ -35,6 +32,7 @@
17 person_logged_in,
18 TestCaseWithFactory,
19 )
20+from lp.testing.matchers import DocTestMatches
21 from lp.testing.views import create_initialized_view
22
23
24@@ -158,12 +156,7 @@
25 spec, '+index')()
26 self.assertThat(
27 extract_text(html), DocTestMatches(
28- extract_text(
29- "... Registered by Some Person a moment ago ..."),
30- (
31- doctest.ELLIPSIS |
32- doctest.NORMALIZE_WHITESPACE |
33- doctest.REPORT_NDIFF)))
34+ "... Registered by Some Person ... ago ..."))
35
36
37 class TestSpecificationEditStatusView(TestCaseWithFactory):
38
39=== modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
40--- lib/lp/code/browser/tests/test_branchlisting.py 2011-11-11 14:12:08 +0000
41+++ lib/lp/code/browser/tests/test_branchlisting.py 2011-11-18 16:33:27 +0000
42@@ -11,6 +11,7 @@
43 import re
44
45 from lazr.uri import URI
46+from lxml import html
47 import soupmatchers
48 from storm.expr import (
49 Asc,
50@@ -59,6 +60,7 @@
51 time_counter,
52 )
53 from lp.testing.factory import remove_security_proxy_and_shout_at_engineer
54+from lp.testing.matchers import DocTestMatches
55 from lp.testing.sampledata import (
56 ADMIN_EMAIL,
57 COMMERCIAL_ADMIN_EMAIL,
58@@ -554,9 +556,12 @@
59 branch = self.factory.makeBranch(sourcepackage=source_package)
60 view = create_initialized_view(
61 dsp, name='+code-index', rootsite='code')
62- html = view()
63- self.assertIn(branch.name, html)
64- self.assertIn('a moment ago</span>\n', html)
65+ root = html.fromstring(view())
66+ [series_branches_table] = root.cssselect("table#series-branches")
67+ series_branches_last_row = series_branches_table.cssselect("tr")[-1]
68+ self.assertThat(
69+ series_branches_last_row.text_content(),
70+ DocTestMatches("%s ... ago" % branch.displayname))
71
72
73 class TestDevelopmentFocusPackageBranches(TestCaseWithFactory):