Merge lp:~deryck/launchpad/move-pagetests-bug-583472 into lp:launchpad

Proposed by Deryck Hodge
Status: Merged
Approved by: Deryck Hodge
Approved revision: no longer in the source branch.
Merged at revision: 10905
Proposed branch: lp:~deryck/launchpad/move-pagetests-bug-583472
Merge into: lp:launchpad
Diff against target: 146 lines (+18/-17)
6 files modified
lib/lp/bugs/browser/cve.py (+3/-0)
lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt (+2/-1)
lib/lp/bugs/stories/cve/cve-pages.txt (+10/-11)
lib/lp/bugs/templates/cve-portlet-bugs2.pt (+2/-2)
lib/lp/bugs/templates/cveset-index.pt (+0/-2)
lib/lp/bugs/templates/malone-portlet-stats.pt (+1/-1)
To merge this branch: bzr merge lp:~deryck/launchpad/move-pagetests-bug-583472
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+25776@code.launchpad.net

Commit message

Move +text and cve page tests from lp.bugs.pagetests to lp.bugs.stories.

Description of the change

This branch moves some page tests that had somehow landed in
lp.bugs.pagetests instead of lp.bugs.stories. These tests were not
being run, so I had to do some work to get them running.

Most of this work was making the CVE pages and test fit the 3.0 design
better. I also fixed up an import for the +text page test.

Cheers,
deryck

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/bugs/templates/malone-portlet-stats.pt
  lib/lp/bugs/templates/cve-portlet-bugs2.pt
  lib/lp/bugs/browser/cve.py
  lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt
  lib/lp/bugs/templates/cveset-index.pt
  lib/lp/bugs/stories/cve/cve-pages.txt

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
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/bugs/browser/cve.py'
2--- lib/lp/bugs/browser/cve.py 2009-09-16 13:44:15 +0000
3+++ lib/lp/bugs/browser/cve.py 2010-05-21 14:05:49 +0000
4@@ -129,6 +129,9 @@
5 if self.text:
6 self.pre_search()
7
8+ label = 'Launchpad CVE tracker'
9+ page_title = label
10+
11 def getAllBatched(self):
12 return BatchNavigator(self.context.getAll(), self.request)
13
14
15=== removed directory 'lib/lp/bugs/pagetests'
16=== removed directory 'lib/lp/bugs/pagetests/bugs'
17=== removed directory 'lib/lp/bugs/pagetests/cve'
18=== renamed file 'lib/lp/bugs/pagetests/bugs/xx-bug-text-pages.txt' => 'lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt'
19--- lib/lp/bugs/pagetests/bugs/xx-bug-text-pages.txt 2009-08-13 15:12:16 +0000
20+++ lib/lp/bugs/stories/bugs/xx-bug-text-pages.txt 2010-05-21 14:05:49 +0000
21@@ -10,7 +10,8 @@
22 >>> import StringIO
23 >>> from canonical.database.sqlbase import flush_database_updates
24 >>> from canonical.launchpad.ftests import login, logout
25- >>> from canonical.launchpad.database import Bug, Person
26+ >>> from lp.bugs.model.bug import Bug
27+ >>> from lp.registry.model.person import Person
28 >>> login("foo.bar@canonical.com")
29 >>> mark = Person.selectOneBy(name="mark")
30 >>> mark.displayname = u"M\xe1rk Sh\xfattlew\xf2rth"
31
32=== renamed file 'lib/lp/bugs/pagetests/cve/cve-pages.txt' => 'lib/lp/bugs/stories/cve/cve-pages.txt'
33--- lib/lp/bugs/pagetests/cve/cve-pages.txt 2009-09-23 11:10:00 +0000
34+++ lib/lp/bugs/stories/cve/cve-pages.txt 2010-05-21 14:05:49 +0000
35@@ -7,7 +7,7 @@
36 >>> browser.open('http://bugs.launchpad.dev/')
37 >>> browser.url
38 'http://bugs.launchpad.dev/'
39- >>> print find_tag_by_id(browser.contents, 'application-footer')
40+ >>> print find_tag_by_id(browser.contents, 'malone-stats')
41 <...2...bugs are related to...CVE entries...
42
43 "CVE entries" links to the main CVEs page, which has the same
44@@ -18,10 +18,10 @@
45 >>> print browser.url
46 http://bugs.launchpad.dev/bugs/cve
47 >>> print_location(browser.contents)
48- Hierarchy: Launchpad
49+ Hierarchy: None displayed
50 Tabs:
51 * Launchpad Home - http://launchpad.dev/
52- * Branches - http://code.launchpad.dev/
53+ * Code - http://code.launchpad.dev/
54 * Bugs (selected) - http://bugs.launchpad.dev/
55 * Blueprints - http://blueprints.launchpad.dev/
56 * Translations - http://translations.launchpad.dev/
57@@ -34,19 +34,19 @@
58
59 The main CVEs page links to a list of all registered CVEs.
60
61- >>> browser.getLink('All registered CVEs').click()
62+ >>> browser.getLink('Show all registered CVEs').click()
63 >>> print browser.url
64 http://bugs.launchpad.dev/bugs/cve/+all
65 >>> print_location(browser.contents)
66- Hierarchy: Launchpad
67+ Hierarchy: None displayed
68 Tabs:
69 * Launchpad Home - http://launchpad.dev/
70- * Branches - http://code.launchpad.dev/
71+ * Code - http://code.launchpad.dev/
72 * Bugs (selected) - http://bugs.launchpad.dev/
73 * Blueprints - http://blueprints.launchpad.dev/
74 * Translations - http://translations.launchpad.dev/
75 * Answers - http://answers.launchpad.dev/
76- Main heading: All registered CVEs
77+ Main heading: Launchpad CVE tracker
78
79 Now, we will test the search functionality of the CVE tracker. First we
80 will search for the word "loss" in the database and see how many show
81@@ -83,10 +83,10 @@
82
83 >>> anon_browser.open('http://launchpad.dev/bugs/cve/2005-2737')
84 >>> print_location(anon_browser.contents)
85- Hierarchy: Launchpad
86+ Hierarchy: None displayed
87 Tabs:
88 * Launchpad Home - http://launchpad.dev/
89- * Branches - http://code.launchpad.dev/
90+ * Code - http://code.launchpad.dev/
91 * Bugs (selected) - http://bugs.launchpad.dev/
92 * Blueprints - http://blueprints.launchpad.dev/
93 * Translations - http://translations.launchpad.dev/
94@@ -105,8 +105,7 @@
95 >>> for tag in find_tags_by_class(
96 ... anon_browser.contents, 'menu-link-linkbug'):
97 ... print tag
98- <a href="http://launchpad.dev/bugs/cve/2005-2737/+linkbug"
99- class="menu-link-linkbug">Link to bug</a>
100+ <a href="+linkbug" class="menu-link-linkbug sprite add">Link to bug</a>
101 >>> 'Candidate' in anon_browser.contents
102 True
103 >>> 'http://marc.theaimsgroup.com/?l=bugtraq&amp;m=112511025414488&amp;w=2">20050826 Multiple PHP' in anon_browser.contents
104
105=== modified file 'lib/lp/bugs/templates/cve-portlet-bugs2.pt'
106--- lib/lp/bugs/templates/cve-portlet-bugs2.pt 2009-11-14 16:08:12 +0000
107+++ lib/lp/bugs/templates/cve-portlet-bugs2.pt 2010-05-21 14:05:49 +0000
108@@ -18,10 +18,10 @@
109
110 <p tal:condition="not: links"><i>No related bugs.</i></p>
111 </div>
112-
113+
114 <ul>
115 <li>
116- <a href="+linkbug" class="sprite add">Link to bug</a>
117+ <a href="+linkbug" class="menu-link-linkbug sprite add">Link to bug</a>
118 </li>
119 <li condition="context/bugs">
120 <a href="+unlinkbug" class="sprite remove">Remove bug link</a>
121
122=== modified file 'lib/lp/bugs/templates/cveset-index.pt'
123--- lib/lp/bugs/templates/cveset-index.pt 2009-09-07 13:38:16 +0000
124+++ lib/lp/bugs/templates/cveset-index.pt 2010-05-21 14:05:49 +0000
125@@ -13,8 +13,6 @@
126
127 <div metal:fill-slot="main">
128
129- <h1>Launchpad CVE tracker</h1>
130-
131 <form method="post" style="margin-top: 1em; margin-bottom: 1em;">
132 <div>Find CVEs by number or keywords:</div>
133 <div>
134
135=== modified file 'lib/lp/bugs/templates/malone-portlet-stats.pt'
136--- lib/lp/bugs/templates/malone-portlet-stats.pt 2010-03-18 18:55:02 +0000
137+++ lib/lp/bugs/templates/malone-portlet-stats.pt 2010-05-21 14:05:49 +0000
138@@ -2,7 +2,7 @@
139 xmlns:tal="http://xml.zope.org/namespaces/tal"
140 xmlns:metal="http://xml.zope.org/namespaces/metal"
141 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
142- class="portlet">
143+ class="portlet" id="malone-stats">
144 <h2>Statistics</h2>
145 <ul>
146 <li>