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
=== modified file 'lib/lp/blueprints/browser/tests/test_specification.py'
--- lib/lp/blueprints/browser/tests/test_specification.py 2011-10-23 00:55:30 +0000
+++ lib/lp/blueprints/browser/tests/test_specification.py 2011-11-18 16:33:27 +0000
@@ -8,10 +8,7 @@
8import unittest8import unittest
99
10import pytz10import pytz
11from testtools.matchers import (11from testtools.matchers import Equals
12 DocTestMatches,
13 Equals,
14 )
15from zope.component import getUtility12from zope.component import getUtility
16from zope.publisher.interfaces import NotFound13from zope.publisher.interfaces import NotFound
17from zope.security.proxy import removeSecurityProxy14from zope.security.proxy import removeSecurityProxy
@@ -35,6 +32,7 @@
35 person_logged_in,32 person_logged_in,
36 TestCaseWithFactory,33 TestCaseWithFactory,
37 )34 )
35from lp.testing.matchers import DocTestMatches
38from lp.testing.views import create_initialized_view36from lp.testing.views import create_initialized_view
3937
4038
@@ -158,12 +156,7 @@
158 spec, '+index')()156 spec, '+index')()
159 self.assertThat(157 self.assertThat(
160 extract_text(html), DocTestMatches(158 extract_text(html), DocTestMatches(
161 extract_text(159 "... Registered by Some Person ... ago ..."))
162 "... Registered by Some Person a moment ago ..."),
163 (
164 doctest.ELLIPSIS |
165 doctest.NORMALIZE_WHITESPACE |
166 doctest.REPORT_NDIFF)))
167160
168161
169class TestSpecificationEditStatusView(TestCaseWithFactory):162class TestSpecificationEditStatusView(TestCaseWithFactory):
170163
=== modified file 'lib/lp/code/browser/tests/test_branchlisting.py'
--- lib/lp/code/browser/tests/test_branchlisting.py 2011-11-11 14:12:08 +0000
+++ lib/lp/code/browser/tests/test_branchlisting.py 2011-11-18 16:33:27 +0000
@@ -11,6 +11,7 @@
11import re11import re
1212
13from lazr.uri import URI13from lazr.uri import URI
14from lxml import html
14import soupmatchers15import soupmatchers
15from storm.expr import (16from storm.expr import (
16 Asc,17 Asc,
@@ -59,6 +60,7 @@
59 time_counter,60 time_counter,
60 )61 )
61from lp.testing.factory import remove_security_proxy_and_shout_at_engineer62from lp.testing.factory import remove_security_proxy_and_shout_at_engineer
63from lp.testing.matchers import DocTestMatches
62from lp.testing.sampledata import (64from lp.testing.sampledata import (
63 ADMIN_EMAIL,65 ADMIN_EMAIL,
64 COMMERCIAL_ADMIN_EMAIL,66 COMMERCIAL_ADMIN_EMAIL,
@@ -554,9 +556,12 @@
554 branch = self.factory.makeBranch(sourcepackage=source_package)556 branch = self.factory.makeBranch(sourcepackage=source_package)
555 view = create_initialized_view(557 view = create_initialized_view(
556 dsp, name='+code-index', rootsite='code')558 dsp, name='+code-index', rootsite='code')
557 html = view()559 root = html.fromstring(view())
558 self.assertIn(branch.name, html)560 [series_branches_table] = root.cssselect("table#series-branches")
559 self.assertIn('a moment ago</span>\n', html)561 series_branches_last_row = series_branches_table.cssselect("tr")[-1]
562 self.assertThat(
563 series_branches_last_row.text_content(),
564 DocTestMatches("%s ... ago" % branch.displayname))
560565
561566
562class TestDevelopmentFocusPackageBranches(TestCaseWithFactory):567class TestDevelopmentFocusPackageBranches(TestCaseWithFactory):