Merge lp:~sinzui/launchpad/answers-ui-fixes into lp:launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Henning Eggers
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/answers-ui-fixes
Merge into: lp:launchpad
Diff against target: 585 lines (+110/-59)
17 files modified
lib/lp/answers/browser/configure.zcml (+11/-0)
lib/lp/answers/browser/faq.py (+12/-7)
lib/lp/answers/browser/question.py (+11/-4)
lib/lp/answers/browser/tests/test_breadcrumbs.py (+28/-0)
lib/lp/answers/stories/faq-add.txt (+1/-1)
lib/lp/answers/stories/faq-browse-and-search.txt (+1/-1)
lib/lp/answers/stories/faq-edit.txt (+1/-1)
lib/lp/answers/stories/project-add-question.txt (+8/-8)
lib/lp/answers/stories/question-add-in-other-languages.txt (+6/-6)
lib/lp/answers/stories/question-add.txt (+5/-5)
lib/lp/answers/stories/question-answer-contact.txt (+2/-2)
lib/lp/answers/stories/question-browse-and-search.txt (+5/-5)
lib/lp/answers/stories/question-message.txt (+3/-3)
lib/lp/answers/stories/question-obfuscation.txt (+5/-5)
lib/lp/answers/stories/question-overview.txt (+1/-1)
lib/lp/answers/stories/this-is-a-faq.txt (+7/-7)
lib/lp/bugs/stories/bugs/xx-bug-create-question.txt (+3/-3)
To merge this branch: bzr merge lp:~sinzui/launchpad/answers-ui-fixes
Reviewer Review Type Date Requested Status
Henning Eggers (community) code Approve
Review via email: mp+14278@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :
Download full text (4.4 KiB)

This is my branch to fix faq and question 3.0 bugs.

    lp:~sinzui/launchpad/faqs-ui-fixes
    Diff size: 562
    Launchpad bug: https://bugs.launchpad.net/bugs/435743
                   https://bugs.launchpad.net/bugs/435973
                   https://bugs.launchpad.net/bugs/434715
    Test command: /bin/test -vvc -t answers.*(browser|stories)
    Pre-implementation: no one
    Target release: 3.1.11

= Convert faq layouts to 3.0 =

Bug 435743 [Bread crumb missing for question and FAQ]
    The last segment of the breadcrumb is missing.

Bug 435973 [FAQ page headings are too verbose]
    The heading should be the FAQ title, but it contains the project and
    id that is expected to appear in the breadcrumbs

Bug 434715 [Button for asking a question is labeled "Add"]
    Change the action from Add to Post Question,

== Rules ==

Bug 435743 [Bread crumb missing for question and FAQ]
    * The FAQ is missing a Breadcrumb adapter; add one:
      FAQ #1234

Bug 435973 [FAQ page headings are too verbose]
    * The heading should be the FAQ title, no more.

Bug 434715 [Button for asking a question is labeled "Add"]
    Change the action from Add to Post Question.

== QA ==

Bug 435743 [Bread crumb missing for question and FAQ]
    Visit an FAQ and verify the breadcrumbs are:
    <project> : questions : faqs : FAQ #<id>

Bug 435973 [FAQ page headings are too verbose]
    Visit an FAQ and verify that the FAQ title is the entire heading

Bug 434715 [Button for asking a question is labeled "Add"]
    Verify the action to create a question is Post Question,

== Lint ==

Linting changed files:
  lib/lp/answers/browser/configure.zcml
  lib/lp/answers/browser/faq.py
  lib/lp/answers/browser/question.py
  lib/lp/answers/browser/tests/test_breadcrumbs.py
  lib/lp/answers/stories/faq-add.txt
  lib/lp/answers/stories/faq-browse-and-search.txt
  lib/lp/answers/stories/faq-edit.txt
  lib/lp/answers/stories/project-add-question.txt
  lib/lp/answers/stories/question-add-in-other-languages.txt
  lib/lp/answers/stories/question-add.txt
  lib/lp/answers/stories/question-answer-contact.txt
  lib/lp/answers/stories/question-browse-and-search.txt
  lib/lp/answers/stories/question-message.txt
  lib/lp/answers/stories/question-obfuscation.txt
  lib/lp/answers/stories/question-overview.txt
  lib/lp/answers/stories/this-is-a-faq.txt

== Test ==

    * lib/lp/answers/browser/tests/test_breadcrumbs.py
      * Added tests for FAQ and Question Breadcrumbs
    * lib/lp/answers/stories/faq-add.txt
      * Updated tests to verify FAQ titles.
    * lib/lp/answers/stories/faq-browse-and-search.txt
      * Updated tests to verify FAQ titles.
    * lib/lp/answers/stories/faq-edit.txt
      * Updated tests to verify FAQ titles.
    * lib/lp/answers/stories/project-add-question.txt
      * Updated tests to verify the create action is Post Question.
      * Updated tests to verify Question titles.
    * lib/lp/answers/stories/question-add-in-other-languages.txt
      * Updated tests to verify the create action is Post Question.
      * Updated tests to verify Question titles.
    * lib/lp/answers/stories/question-add.txt
      * Updated tests to verify the create action is Post Qu...

Read more...

Revision history for this message
Henning Eggers (henninge) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 01.11.2009 06:30, Curtis Hovey schrieb:
> Curtis Hovey has proposed merging lp:~sinzui/launchpad/answers-ui-fixes into lp:launchpad/devel.
> This is my branch to fix faq and question 3.0 bugs.

Wonderful! Thank you for doing this, including the tedious work of
fixing all tests. Thank you. I am just curious, why you changed some
page title tests to leave out the greater context, like this:

> - Questions : Ubuntu
> + Question #11 : ...

since you did this in other places:

> - Questions : Ubuntu
> + FAQ #4 : Questions : Ubuntu

No big deal, but it actually seems more work to me to remove the context
and I just wonder if you did it consciously.

One more thing:

> === modified file 'lib/lp/answers/browser/tests/test_breadcrumbs.py'
> --- lib/lp/answers/browser/tests/test_breadcrumbs.py 2009-09-22 18:45:02 +0000
> +++ lib/lp/answers/browser/tests/test_breadcrumbs.py 2009-11-01 05:30:29 +0000
> @@ -9,6 +9,8 @@
> from canonical.launchpad.webapp.tests.breadcrumbs import (
> BaseBreadcrumbTestCase)
>
> +from lp.testing import login_person
> +
>
> class TestQuestionTargetProjectAndPersonBreadcrumbOnAnswersVHost(
> BaseBreadcrumbTestCase):
> @@ -55,5 +57,31 @@
> self.assertEquals(last_crumb.text, 'Questions')
>
>
> +class TestAnswersBreadcrumb(BaseBreadcrumbTestCase):
> + """Test Breadcrumbs for answer module objects."""
> +
> + def setUp(self):
> + super(TestAnswersBreadcrumb, self).setUp()
> + self.product = self.factory.makeProduct(name="mellon")
> + login_person(self.product.owner)
> + self.question = self.factory.makeQuestion(
> + target=self.product, title='Seeds are hard to chew')
> + self.question_url = canonical_url(self.question, rootsite='answers')

self.question and self.question_url are not needed in all tests, are
they? I think they should be local to test_question.

> + self.faq = self.factory.makeFAQ(target=self.product, title='Seedless')
> + self.faq_url = canonical_url(self.faq, rootsite='answers')

Same goes for self.faq and self.faq_url

> +
> + def test_question(self):

question = ...
question_url = ...

(You get my point ... ;-)

> + crumbs = self._getBreadcrumbs(
> + self.question_url, [self.root, self.product, self.question])
> + last_crumb = crumbs[-1]
> + self.assertEquals(last_crumb.text, 'Question #%d' % self.question.id)
> +
> + def test_faq(self):
> + crumbs = self._getBreadcrumbs(
> + self.faq_url, [self.root, self.product, self.faq])
> + last_crumb = crumbs[-1]
> + self.assertEquals(last_crumb.text, 'FAQ #%d' % self.faq.id)
> +
> +
> def test_suite():
> return unittest.TestLoader().loadTestsFromName(__name__)

 review approve code
 merge approved

Cheers,
Henning
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrux6QACgkQBT3oW1L17iiQQwCg3MatFcXV44ulMsjsmf10Ihwx
AfsAoMHKgRGxivRfTfQij6B397j4/uIR
=dWuq
-----END PGP SIGNATURE-----

review: Approve (code)
Revision history for this message
Curtis Hovey (sinzui) wrote :

On Mon, 2009-11-02 at 11:51 +0000, Henning Eggers wrote:
> Review: Approve code
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 01.11.2009 06:30, Curtis Hovey schrieb:
> > Curtis Hovey has proposed merging lp:~sinzui/launchpad/answers-ui-fixes into lp:launchpad/devel.
> > This is my branch to fix faq and question 3.0 bugs.
>
> Wonderful! Thank you for doing this, including the tedious work of
> fixing all tests. Thank you. I am just curious, why you changed some
> page title tests to leave out the greater context, like this:
>
> > - Questions : Ubuntu
> > + Question #11 : ...
>
> since you did this in other places:
>
> > - Questions : Ubuntu
> > + FAQ #4 : Questions : Ubuntu
>
> No big deal, but it actually seems more work to me to remove the context
> and I just wonder if you did it consciously.

I wanted to know all "add question" or "retarget question" titles
because the pillar is not always the same as it was.

I ellipsised the other titles that user is viewing because the
breadcrumb/title rules are well tested. These will not break if a
retargeting test is inserted.

> One more thing:
>
> > === modified file 'lib/lp/answers/browser/tests/test_breadcrumbs.py'
> > --- lib/lp/answers/browser/tests/test_breadcrumbs.py 2009-09-22 18:45:02 +0000
> > +++ lib/lp/answers/browser/tests/test_breadcrumbs.py 2009-11-01 05:30:29 +0000
...
> > +class TestAnswersBreadcrumb(BaseBreadcrumbTestCase):
> > + """Test Breadcrumbs for answer module objects."""
> > +
> > + def setUp(self):
> > + super(TestAnswersBreadcrumb, self).setUp()
> > + self.product = self.factory.makeProduct(name="mellon")
> > + login_person(self.product.owner)
> > + self.question = self.factory.makeQuestion(
> > + target=self.product, title='Seeds are hard to chew')
> > + self.question_url = canonical_url(self.question, rootsite='answers')
>
> self.question and self.question_url are not needed in all tests, are
> they? I think they should be local to test_question.

I moved them.

--
__Curtis C. Hovey_________
http://launchpad.net/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/answers/browser/configure.zcml'
--- lib/lp/answers/browser/configure.zcml 2009-09-18 20:03:54 +0000
+++ lib/lp/answers/browser/configure.zcml 2009-11-07 04:51:13 +0000
@@ -136,6 +136,12 @@
136 rootsite="answers"136 rootsite="answers"
137 />137 />
138138
139 <adapter
140 provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
141 for="lp.answers.interfaces.question.IQuestion"
142 factory="lp.answers.browser.question.QuestionBreadcrumb"
143 permission="zope.Public"/>
144
139 <browser:pages145 <browser:pages
140 for="lp.answers.interfaces.question.IQuestion"146 for="lp.answers.interfaces.question.IQuestion"
141 permission="zope.Public"147 permission="zope.Public"
@@ -343,6 +349,11 @@
343 permission="launchpad.Edit"349 permission="launchpad.Edit"
344 template="../../app/templates/generic-edit.pt"350 template="../../app/templates/generic-edit.pt"
345 />351 />
352 <adapter
353 provides="canonical.launchpad.webapp.interfaces.IBreadcrumb"
354 for="lp.answers.interfaces.faq.IFAQ"
355 factory="lp.answers.browser.faq.FAQBreadcrumb"
356 permission="zope.Public"/>
346357
347 <browser:defaultView358 <browser:defaultView
348 for="canonical.launchpad.interfaces.IPerson"359 for="canonical.launchpad.interfaces.IPerson"
349360
=== modified file 'lib/lp/answers/browser/faq.py'
--- lib/lp/answers/browser/faq.py 2009-09-18 20:03:54 +0000
+++ lib/lp/answers/browser/faq.py 2009-11-07 04:51:13 +0000
@@ -6,6 +6,7 @@
6__metaclass__ = type6__metaclass__ = type
77
8__all__ = [8__all__ = [
9 'FAQBreadcrumb',
9 'FAQNavigationMenu',10 'FAQNavigationMenu',
10 'FAQEditView',11 'FAQEditView',
11 'FAQView',12 'FAQView',
@@ -15,6 +16,7 @@
15from canonical.launchpad.webapp import (16from canonical.launchpad.webapp import (
16 action, NavigationMenu, canonical_url, enabled_with_permission,17 action, NavigationMenu, canonical_url, enabled_with_permission,
17 LaunchpadView, LaunchpadEditFormView, Link)18 LaunchpadView, LaunchpadEditFormView, Link)
19from canonical.launchpad.webapp.breadcrumb import Breadcrumb
1820
19from lp.answers.browser.faqcollection import FAQCollectionMenu21from lp.answers.browser.faqcollection import FAQCollectionMenu
20from lp.answers.interfaces.faq import IFAQ22from lp.answers.interfaces.faq import IFAQ
@@ -44,19 +46,22 @@
44 return Link(url, 'List all FAQs', icon='info')46 return Link(url, 'List all FAQs', icon='info')
4547
4648
49class FAQBreadcrumb(Breadcrumb):
50 """Builds a breadcrumb for an `IFAQ`."""
51
52 @property
53 def text(self):
54 return 'FAQ #%d' % self.context.id
55
56
47class FAQView(LaunchpadView):57class FAQView(LaunchpadView):
48 """View for the FAQ index."""58 """View for the FAQ index."""
4959
50 __used_for__ = IFAQ60 __used_for__ = IFAQ
5161
52 @property62 @property
53 def page_title(self):63 def label(self):
54 return '%s FAQ #%d: "%s"' % (64 return self.context.title
55 self.context.target.displayname,
56 self.context.id,
57 self.context.title)
58
59 label = page_title
6065
6166
62class FAQEditView(LaunchpadEditFormView):67class FAQEditView(LaunchpadEditFormView):
6368
=== modified file 'lib/lp/answers/browser/question.py'
--- lib/lp/answers/browser/question.py 2009-10-05 15:32:50 +0000
+++ lib/lp/answers/browser/question.py 2009-11-07 04:51:13 +0000
@@ -8,6 +8,7 @@
8__all__ = [8__all__ = [
9 'SearchAllQuestionsView',9 'SearchAllQuestionsView',
10 'QuestionAddView',10 'QuestionAddView',
11 'QuestionBreadcrumb',
11 'QuestionChangeStatusView',12 'QuestionChangeStatusView',
12 'QuestionConfirmAnswerView',13 'QuestionConfirmAnswerView',
13 'QuestionCreateFAQView',14 'QuestionCreateFAQView',
@@ -65,6 +66,7 @@
65 LaunchpadFormView, LaunchpadEditFormView, custom_widget, redirection,66 LaunchpadFormView, LaunchpadEditFormView, custom_widget, redirection,
66 safe_action, NavigationMenu)67 safe_action, NavigationMenu)
67from canonical.launchpad.webapp.authorization import check_permission68from canonical.launchpad.webapp.authorization import check_permission
69from canonical.launchpad.webapp.breadcrumb import Breadcrumb
68from canonical.launchpad.webapp.interfaces import IAlwaysSubmittedWidget70from canonical.launchpad.webapp.interfaces import IAlwaysSubmittedWidget
69from canonical.launchpad.webapp.menu import structured71from canonical.launchpad.webapp.menu import structured
70from canonical.widgets import LaunchpadRadioWidget, TokensTextWidget72from canonical.widgets import LaunchpadRadioWidget, TokensTextWidget
@@ -191,6 +193,14 @@
191 return redirection(canonical_url(question), status=301)193 return redirection(canonical_url(question), status=301)
192194
193195
196class QuestionBreadcrumb(Breadcrumb):
197 """Builds a breadcrumb for an `IQuestion`."""
198
199 @property
200 def text(self):
201 return 'Question #%d' % self.context.id
202
203
194class QuestionSetView(LaunchpadFormView):204class QuestionSetView(LaunchpadFormView):
195 """View for the Answer Tracker index page."""205 """View for the Answer Tracker index page."""
196206
@@ -592,10 +602,7 @@
592 return self.search_template()602 return self.search_template()
593 return self.continue_action.success(data)603 return self.continue_action.success(data)
594604
595 # XXX flacoste 2006-07-26: We use the method here instead of605 @action(_('Post Question'), name='add', failure='handleAddError')
596 # using the method name 'handleAddError' because of Zope issue 573
597 # which is fixed in 3.3.0b1 and 3.2.1
598 @action(_('Add'), failure=handleAddError)
599 def add_action(self, action, data):606 def add_action(self, action, data):
600 """Add a Question to an `IQuestionTarget`."""607 """Add a Question to an `IQuestionTarget`."""
601 if self.shouldWarnAboutUnsupportedLanguage():608 if self.shouldWarnAboutUnsupportedLanguage():
602609
=== modified file 'lib/lp/answers/browser/tests/test_breadcrumbs.py'
--- lib/lp/answers/browser/tests/test_breadcrumbs.py 2009-09-22 18:45:02 +0000
+++ lib/lp/answers/browser/tests/test_breadcrumbs.py 2009-11-07 04:51:13 +0000
@@ -9,6 +9,8 @@
9from canonical.launchpad.webapp.tests.breadcrumbs import (9from canonical.launchpad.webapp.tests.breadcrumbs import (
10 BaseBreadcrumbTestCase)10 BaseBreadcrumbTestCase)
1111
12from lp.testing import login_person
13
1214
13class TestQuestionTargetProjectAndPersonBreadcrumbOnAnswersVHost(15class TestQuestionTargetProjectAndPersonBreadcrumbOnAnswersVHost(
14 BaseBreadcrumbTestCase):16 BaseBreadcrumbTestCase):
@@ -55,5 +57,31 @@
55 self.assertEquals(last_crumb.text, 'Questions')57 self.assertEquals(last_crumb.text, 'Questions')
5658
5759
60class TestAnswersBreadcrumb(BaseBreadcrumbTestCase):
61 """Test Breadcrumbs for answer module objects."""
62
63 def setUp(self):
64 super(TestAnswersBreadcrumb, self).setUp()
65 self.product = self.factory.makeProduct(name="mellon")
66 login_person(self.product.owner)
67
68 def test_question(self):
69 self.question = self.factory.makeQuestion(
70 target=self.product, title='Seeds are hard to chew')
71 self.question_url = canonical_url(self.question, rootsite='answers')
72 crumbs = self._getBreadcrumbs(
73 self.question_url, [self.root, self.product, self.question])
74 last_crumb = crumbs[-1]
75 self.assertEquals(last_crumb.text, 'Question #%d' % self.question.id)
76
77 def test_faq(self):
78 self.faq = self.factory.makeFAQ(target=self.product, title='Seedless')
79 self.faq_url = canonical_url(self.faq, rootsite='answers')
80 crumbs = self._getBreadcrumbs(
81 self.faq_url, [self.root, self.product, self.faq])
82 last_crumb = crumbs[-1]
83 self.assertEquals(last_crumb.text, 'FAQ #%d' % self.faq.id)
84
85
58def test_suite():86def test_suite():
59 return unittest.TestLoader().loadTestsFromName(__name__)87 return unittest.TestLoader().loadTestsFromName(__name__)
6088
=== modified file 'lib/lp/answers/stories/faq-add.txt'
--- lib/lp/answers/stories/faq-add.txt 2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/faq-add.txt 2009-11-07 04:51:13 +0000
@@ -67,7 +67,7 @@
67 >>> owner_browser.url67 >>> owner_browser.url
68 'http://answers.launchpad.dev/firefox/+faq/...'68 'http://answers.launchpad.dev/firefox/+faq/...'
69 >>> print owner_browser.title69 >>> print owner_browser.title
70 Questions : Mozilla Firefox70 FAQ #12 : Questions : Mozilla Firefox
7171
72 >>> content = find_main_content(owner_browser.contents)72 >>> content = find_main_content(owner_browser.contents)
73 >>> extract_text(content.find('div', {'id' : 'faq-keywords'}))73 >>> extract_text(content.find('div', {'id' : 'faq-keywords'}))
7474
=== modified file 'lib/lp/answers/stories/faq-browse-and-search.txt'
--- lib/lp/answers/stories/faq-browse-and-search.txt 2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/faq-browse-and-search.txt 2009-11-07 04:51:13 +0000
@@ -70,7 +70,7 @@
7070
71 >>> browser.getLink('How can I play MP3/Divx').click()71 >>> browser.getLink('How can I play MP3/Divx').click()
72 >>> print backslashreplace(browser.title)72 >>> print backslashreplace(browser.title)
73 Questions : Ubuntu73 FAQ #6 : Questions : Ubuntu
74 >>> print browser.url74 >>> print browser.url
75 http://answers.launchpad.dev/ubuntu/+faq/675 http://answers.launchpad.dev/ubuntu/+faq/6
7676
7777
=== modified file 'lib/lp/answers/stories/faq-edit.txt'
--- lib/lp/answers/stories/faq-edit.txt 2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/faq-edit.txt 2009-11-07 04:51:12 +0000
@@ -11,7 +11,7 @@
11 >>> from canonical.launchpad.helpers import backslashreplace11 >>> from canonical.launchpad.helpers import backslashreplace
12 >>> anon_browser.open('http://answers.launchpad.dev/firefox/+faq/7')12 >>> anon_browser.open('http://answers.launchpad.dev/firefox/+faq/7')
13 >>> print backslashreplace(anon_browser.title)13 >>> print backslashreplace(anon_browser.title)
14 Questions : Mozilla Firefox14 FAQ #7 : Questions : Mozilla Firefox
1515
16 >>> anon_browser.getLink('Edit FAQ')16 >>> anon_browser.getLink('Edit FAQ')
17 Traceback (most recent call last):17 Traceback (most recent call last):
1818
=== modified file 'lib/lp/answers/stories/project-add-question.txt'
--- lib/lp/answers/stories/project-add-question.txt 2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/project-add-question.txt 2009-11-07 04:51:13 +0000
@@ -85,7 +85,7 @@
85as he revises the summary after reading the similar questions.85as he revises the summary after reading the similar questions.
8686
87 >>> user_browser.getControl('Summary').value = ''87 >>> user_browser.getControl('Summary').value = ''
88 >>> user_browser.getControl('Add').click()88 >>> user_browser.getControl('Post Question').click()
8989
90An error message in the page informs the user that the summary is90An error message in the page informs the user that the summary is
91missing:91missing:
@@ -114,13 +114,13 @@
114 entered.114 entered.
115115
116The user then elaborates upon his question by entering a description116The user then elaborates upon his question by entering a description
117of the problem. He submits the form using the 'Add' button.117of the problem. He submits the form using the 'Post Question' button.
118118
119 >>> user_browser.getControl('Description').value = (119 >>> user_browser.getControl('Description').value = (
120 ... "I received an HTML message containing an inlined SVG\n"120 ... "I received an HTML message containing an inlined SVG\n"
121 ... "representation of a chessboard. It didn't displayed properly.\n"121 ... "representation of a chessboard. It didn't displayed properly.\n"
122 ... "Is there a way to configure Thunderbird to display SVG properly?\n")122 ... "Is there a way to configure Thunderbird to display SVG properly?\n")
123 >>> user_browser.getControl('Add').click()123 >>> user_browser.getControl('Post Question').click()
124124
125No Privileged Person is taken to page displaying his question. From125No Privileged Person is taken to page displaying his question. From
126this point on, the user's interaction with the question follows to126this point on, the user's interaction with the question follows to
@@ -129,7 +129,7 @@
129 >>> user_browser.url129 >>> user_browser.url
130 '.../thunderbird/+question/...'130 '.../thunderbird/+question/...'
131 >>> print user_browser.title131 >>> print user_browser.title
132 Questions : Mozilla Thunderbird132 Question #... : Questions : Mozilla Thunderbird
133133
134134
135== Supported Language behaviour ==135== Supported Language behaviour ==
@@ -275,7 +275,7 @@
275supported by Dafydd, but No Privileges Person will never know that.275supported by Dafydd, but No Privileges Person will never know that.
276Let's stop here. The rest of this scenario is just adding a question276Let's stop here. The rest of this scenario is just adding a question
277as described above--filling in a description and submitting the data277as described above--filling in a description and submitting the data
278with the 'Add' button.278with the 'Post Question' button.
279279
280==== Supported languages are displayed after the submitting a product ====280==== Supported languages are displayed after the submitting a product ====
281281
@@ -311,7 +311,7 @@
311311
312No Privileges Person sets the language to Japanese, changes his312No Privileges Person sets the language to Japanese, changes his
313question summary, writes a description, and submits the form with the313question summary, writes a description, and submits the form with the
314'Add' button.314'Post Question' button.
315315
316 >>> print user_browser.getControl('Project').displayValue316 >>> print user_browser.getControl('Project').displayValue
317 ['Mozilla Thunderbird']317 ['Mozilla Thunderbird']
@@ -320,7 +320,7 @@
320 ... 'Pretend this is written in Japanese')320 ... 'Pretend this is written in Japanese')
321 >>> user_browser.getControl('Description').value = (321 >>> user_browser.getControl('Description').value = (
322 ... "Something in kanji and hiragana.")322 ... "Something in kanji and hiragana.")
323 >>> user_browser.getControl('Add').click()323 >>> user_browser.getControl('Post Question').click()
324324
325The user is taken to page displaying his question. Changing the325The user is taken to page displaying his question. Changing the
326language or the summary did not search for similar questions326language or the summary did not search for similar questions
@@ -329,4 +329,4 @@
329 >>> user_browser.url329 >>> user_browser.url
330 '.../thunderbird/+question/...'330 '.../thunderbird/+question/...'
331 >>> print user_browser.title331 >>> print user_browser.title
332 Questions : Mozilla Thunderbird332 Question #... : Questions : Mozilla Thunderbird
333333
=== modified file 'lib/lp/answers/stories/question-add-in-other-languages.txt'
--- lib/lp/answers/stories/question-add-in-other-languages.txt 2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/question-add-in-other-languages.txt 2009-11-07 04:51:13 +0000
@@ -74,11 +74,11 @@
74 ... u'carrega corretamente e mostra a minha versao do java. No '74 ... u'carrega corretamente e mostra a minha versao do java. No '
75 ... u'entanto, mover o mouse na pagina faz com que o firefox quebre.'75 ... u'entanto, mover o mouse na pagina faz com que o firefox quebre.'
76 ... ).encode('utf-8')76 ... ).encode('utf-8')
77 >>> browser.getControl('Add').click()77 >>> browser.getControl('Post Question').click()
78 >>> browser.url78 >>> browser.url
79 '.../ubuntu/+question/...'79 '.../ubuntu/+question/...'
80 >>> print browser.title80 >>> print browser.title
81 Questions : Ubuntu81 Question #... : Questions : Ubuntu
8282
83The page reports the question language both in the content and in the83The page reports the question language both in the content and in the
84markup. Search engine robots and browsers will use the lang and dir84markup. Search engine robots and browsers will use the lang and dir
@@ -117,7 +117,7 @@
117 >>> browser.getControl('Summary').value = 'Gofyn cymorth'117 >>> browser.getControl('Summary').value = 'Gofyn cymorth'
118 >>> browser.getControl('Description').value = (118 >>> browser.getControl('Description').value = (
119 ... 'Ghai damweiniol gair.')119 ... 'Ghai damweiniol gair.')
120 >>> browser.getControl('Add').click()120 >>> browser.getControl('Post Question').click()
121121
122 >>> browser.url122 >>> browser.url
123 'http://launchpad.dev/ubuntu/+addquestion'123 'http://launchpad.dev/ubuntu/+addquestion'
@@ -138,7 +138,7 @@
138 ... u'\u52a9\u3051\u306e\u8981\u6c42'.encode('utf-8'))138 ... u'\u52a9\u3051\u306e\u8981\u6c42'.encode('utf-8'))
139 >>> browser.getControl('Description').value = (139 >>> browser.getControl('Description').value = (
140 ... u'\u3042\u308b\u4efb\u610f\u5358\u8a9e\u3002'.encode('utf-8'))140 ... u'\u3042\u308b\u4efb\u610f\u5358\u8a9e\u3002'.encode('utf-8'))
141 >>> browser.getControl('Add').click()141 >>> browser.getControl('Post Question').click()
142142
143 >>> for tag in find_tags_by_class(browser.contents, 'warning message'):143 >>> for tag in find_tags_by_class(browser.contents, 'warning message'):
144 ... print tag.renderContents()144 ... print tag.renderContents()
@@ -151,9 +151,9 @@
151If even after the warning he decides to go ahead, we have to accept the151If even after the warning he decides to go ahead, we have to accept the
152new question.152new question.
153153
154 >>> browser.getControl('Add').click()154 >>> browser.getControl('Post Question').click()
155 >>> browser.url155 >>> browser.url
156 '.../ubuntu/+question/...'156 '.../ubuntu/+question/...'
157 >>> print browser.title.decode('utf-8')157 >>> print browser.title.decode('utf-8')
158 Questions : Ubuntu158 Question #... : Questions : Ubuntu
159 >>> portlet = find_tag_by_id(browser.contents, 'portlet-details')159 >>> portlet = find_tag_by_id(browser.contents, 'portlet-details')
160160
=== modified file 'lib/lp/answers/stories/question-add.txt'
--- lib/lp/answers/stories/question-add.txt 2009-09-24 16:07:49 +0000
+++ lib/lp/answers/stories/question-add.txt 2009-11-07 04:51:13 +0000
@@ -123,7 +123,7 @@
123123
124If the user doesn't provide details, he'll get an error message:124If the user doesn't provide details, he'll get an error message:
125125
126 >>> user_browser.getControl('Add').click()126 >>> user_browser.getControl('Post Question').click()
127 >>> for message in get_feedback_messages(user_browser.contents):127 >>> for message in get_feedback_messages(user_browser.contents):
128 ... print message128 ... print message
129 There is 1 error.129 There is 1 error.
@@ -133,7 +133,7 @@
133first step:133first step:
134134
135 >>> user_browser.getControl('Summary').value = ''135 >>> user_browser.getControl('Summary').value = ''
136 >>> user_browser.getControl('Add').click()136 >>> user_browser.getControl('Post Question').click()
137 >>> for message in get_feedback_messages(user_browser.contents):137 >>> for message in get_feedback_messages(user_browser.contents):
138 ... print message138 ... print message
139 There are 2 errors.139 There are 2 errors.
@@ -151,11 +151,11 @@
151 ... "http://java.com/en/download/help/testvm.xml, the page loads ok and\n"151 ... "http://java.com/en/download/help/testvm.xml, the page loads ok and\n"
152 ... "shows my java version. But if I move the mouse on the page, firefox\n"152 ... "shows my java version. But if I move the mouse on the page, firefox\n"
153 ... "crashes.\n")153 ... "crashes.\n")
154 >>> user_browser.getControl('Add').click()154 >>> user_browser.getControl('Post Question').click()
155 >>> user_browser.url155 >>> user_browser.url
156 '.../ubuntu/+source/mozilla-firefox/+question/...'156 '.../ubuntu/+source/mozilla-firefox/+question/...'
157 >>> user_browser.title157 >>> print user_browser.title
158 'Questions : \xe2\x80\x9cmozilla-firefox\xe2\x80\x9d package : Ubuntu'158 Question #... : Questions : ...mozilla-firefox... package : Ubuntu
159159
160 >>> print extract_text(160 >>> print extract_text(
161 ... find_tag_by_id(user_browser.contents, 'registration'))161 ... find_tag_by_id(user_browser.contents, 'registration'))
162162
=== modified file 'lib/lp/answers/stories/question-answer-contact.txt'
--- lib/lp/answers/stories/question-answer-contact.txt 2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/question-answer-contact.txt 2009-11-07 04:51:13 +0000
@@ -193,7 +193,7 @@
193193
194 >>> browser.getLink('Play DVDs in Totem').click()194 >>> browser.getLink('Play DVDs in Totem').click()
195 >>> print extract_text(browser.title)195 >>> print extract_text(browser.title)
196 Questions : Ubuntu196 Question #10 : ...
197197
198 >>> print extract_text(find_tag_by_id(browser.contents, 'question-lang'))198 >>> print extract_text(find_tag_by_id(browser.contents, 'question-lang'))
199 Language: English199 Language: English
@@ -210,7 +210,7 @@
210210
211 >>> browser.open('http://answers.launchpad.dev/ubuntu/+question/12')211 >>> browser.open('http://answers.launchpad.dev/ubuntu/+question/12')
212 >>> print browser.title212 >>> print browser.title
213 Questions : Ubuntu213 Question #12 : ...
214214
215 >>> print extract_text(find_tag_by_id(browser.contents, 'question-lang'))215 >>> print extract_text(find_tag_by_id(browser.contents, 'question-lang'))
216 Language: Spanish216 Language: Spanish
217217
=== modified file 'lib/lp/answers/stories/question-browse-and-search.txt'
--- lib/lp/answers/stories/question-browse-and-search.txt 2009-09-28 09:11:17 +0000
+++ lib/lp/answers/stories/question-browse-and-search.txt 2009-11-07 04:51:13 +0000
@@ -116,7 +116,7 @@
116116
117 >>> browser.getLink('Slow system').click()117 >>> browser.getLink('Slow system').click()
118 >>> print browser.title118 >>> print browser.title
119 Questions : Ubuntu119 Question #7 : ...
120 >>> soup = find_main_content(browser.contents)120 >>> soup = find_main_content(browser.contents)
121 >>> soup('div', 'report')121 >>> soup('div', 'report')
122 [<div class="report"><p>I get really poor hard drive performance.</p></div>]122 [<div class="report"><p>I get really poor hard drive performance.</p></div>]
@@ -139,7 +139,7 @@
139 >>> from canonical.launchpad.helpers import backslashreplace139 >>> from canonical.launchpad.helpers import backslashreplace
140 >>> locators = find_tags_by_class(browser.contents, 'main')140 >>> locators = find_tags_by_class(browser.contents, 'main')
141 >>> print backslashreplace(browser.title)141 >>> print backslashreplace(browser.title)
142 Questions : \u201cmozilla-firefox\u201d package : Ubuntu142 Question #9 : ...
143143
144While reading the Ubuntu forums for a solution to his problem,144While reading the Ubuntu forums for a solution to his problem,
145Average Joe finds some unlinked text that refers to how to145Average Joe finds some unlinked text that refers to how to
@@ -151,7 +151,7 @@
151 >>> browser.getControl(name='field.search_text').value = ' #6 '151 >>> browser.getControl(name='field.search_text').value = ' #6 '
152 >>> browser.getControl('Find Answers').click()152 >>> browser.getControl('Find Answers').click()
153 >>> print backslashreplace(browser.title)153 >>> print backslashreplace(browser.title)
154 Questions : Mozilla Firefox154 Question #6 : ...
155155
156The Answer Tracker cannot identify Question ids within text. Average156The Answer Tracker cannot identify Question ids within text. Average
157Joe finds a reference to question 8 in a blog. He copies 'question 8'157Joe finds a reference to question 8 in a blog. He copies 'question 8'
@@ -216,8 +216,8 @@
216He clicks on the link to read the question description.216He clicks on the link to read the question description.
217217
218 >>> browser.getLink('Firefox is slow').click()218 >>> browser.getLink('Firefox is slow').click()
219 >>> browser.title219 >>> print browser.title
220 'Questions : \xe2\x80\x9cmozilla-firefox\xe2\x80\x9d package : Ubuntu'220 Question #3 : ...
221221
222The user must choose at least one status when searching questions. An222The user must choose at least one status when searching questions. An
223error is displayed when the user forgets to select a status.223error is displayed when the user forgets to select a status.
224224
=== modified file 'lib/lp/answers/stories/question-message.txt'
--- lib/lp/answers/stories/question-message.txt 2009-09-28 09:11:17 +0000
+++ lib/lp/answers/stories/question-message.txt 2009-11-07 04:51:13 +0000
@@ -12,7 +12,7 @@
1212
13 >>> user_browser.open('http://answers.launchpad.dev/ubuntu/+question/11')13 >>> user_browser.open('http://answers.launchpad.dev/ubuntu/+question/11')
14 >>> print user_browser.title.decode('utf-8')14 >>> print user_browser.title.decode('utf-8')
15 Questions : Ubuntu15 Question #11 : ...
1616
17 >>> user_browser.getControl('Message').value = (17 >>> user_browser.getControl('Message').value = (
18 ... "Top quoting is bad netiquette.\n"18 ... "Top quoting is bad netiquette.\n"
@@ -37,7 +37,7 @@
37authenticated already, He will see 'human@somewhere.org'37authenticated already, He will see 'human@somewhere.org'
3838
39 >>> print user_browser.title.decode('utf-8')39 >>> print user_browser.title.decode('utf-8')
40 Questions : Ubuntu40 Question #11 : ...
41 >>> text = find_tags_by_class(41 >>> text = find_tags_by_class(
42 ... user_browser.contents, 'boardCommentBody')[-1]42 ... user_browser.contents, 'boardCommentBody')[-1]
43 >>> print extract_text(text.findAll('p')[-1])43 >>> print extract_text(text.findAll('p')[-1])
@@ -52,7 +52,7 @@
5252
53 >>> anon_browser.open('http://answers.launchpad.dev/ubuntu/+question/11')53 >>> anon_browser.open('http://answers.launchpad.dev/ubuntu/+question/11')
54 >>> print anon_browser.title54 >>> print anon_browser.title
55 Questions : Ubuntu55 Question #11 : ...
5656
57 >>> text = find_tags_by_class(57 >>> text = find_tags_by_class(
58 ... anon_browser.contents, 'boardCommentBody')[-1]58 ... anon_browser.contents, 'boardCommentBody')[-1]
5959
=== modified file 'lib/lp/answers/stories/question-obfuscation.txt'
--- lib/lp/answers/stories/question-obfuscation.txt 2009-09-28 09:11:17 +0000
+++ lib/lp/answers/stories/question-obfuscation.txt 2009-11-07 04:51:13 +0000
@@ -54,7 +54,7 @@
54 >>> user_browser.getControl('Link to FAQ').click()54 >>> user_browser.getControl('Link to FAQ').click()
55 >>> user_browser.getLink('How can I make VOIP calls?').click()55 >>> user_browser.getLink('How can I make VOIP calls?').click()
56 >>> print user_browser.title56 >>> print user_browser.title
57 Questions : Ubuntu57 FAQ #4 : Questions : Ubuntu
5858
59 >>> portlet = find_portlet(user_browser.contents, 'Related questions')59 >>> portlet = find_portlet(user_browser.contents, 'Related questions')
60 >>> portlet.a['title']60 >>> portlet.a['title']
@@ -74,9 +74,9 @@
74 >>> user_browser.getControl('Continue').click()74 >>> user_browser.getControl('Continue').click()
75 >>> user_browser.getControl('Description').value = (75 >>> user_browser.getControl('Description').value = (
76 ... 'The clicking mailto:user@domain.com crashes the browser.')76 ... 'The clicking mailto:user@domain.com crashes the browser.')
77 >>> user_browser.getControl('Add').click()77 >>> user_browser.getControl('Post Question').click()
78 >>> user_browser.title78 >>> print user_browser.title
79 'Questions : \xe2\x80\x9cmozilla-firefox\xe2\x80\x9d package : Ubuntu'79 Question #... : ...
8080
81 >>> user_browser.open('http://answers.launchpad.dev/')81 >>> user_browser.open('http://answers.launchpad.dev/')
82 >>> question_portlet = find_tag_by_id(82 >>> question_portlet = find_tag_by_id(
@@ -144,7 +144,7 @@
144144
145 >>> anon_browser.getLink('How can I make VOIP calls?').click()145 >>> anon_browser.getLink('How can I make VOIP calls?').click()
146 >>> print anon_browser.title146 >>> print anon_browser.title
147 Questions : Ubuntu147 FAQ #4 : Questions : Ubuntu
148148
149 >>> portlet = find_portlet(anon_browser.contents, 'Related questions')149 >>> portlet = find_portlet(anon_browser.contents, 'Related questions')
150 >>> portlet.a['title']150 >>> portlet.a['title']
151151
=== modified file 'lib/lp/answers/stories/question-overview.txt'
--- lib/lp/answers/stories/question-overview.txt 2009-09-23 14:40:53 +0000
+++ lib/lp/answers/stories/question-overview.txt 2009-11-07 04:51:12 +0000
@@ -53,7 +53,7 @@
5353
54 >>> browser.getLink('Problem showing the SVG demo on W3C site').click()54 >>> browser.getLink('Problem showing the SVG demo on W3C site').click()
55 >>> print browser.title55 >>> print browser.title
56 Questions : Mozilla Firefox56 Question #2 : ...
57 >>> print find_main_content(browser.contents).first('h1').renderContents()57 >>> print find_main_content(browser.contents).first('h1').renderContents()
58 Problem showing the SVG demo on W3C site58 Problem showing the SVG demo on W3C site
5959
6060
=== modified file 'lib/lp/answers/stories/this-is-a-faq.txt'
--- lib/lp/answers/stories/this-is-a-faq.txt 2009-10-05 15:32:50 +0000
+++ lib/lp/answers/stories/this-is-a-faq.txt 2009-11-07 04:51:13 +0000
@@ -21,7 +21,7 @@
21 >>> user_browser.open(21 >>> user_browser.open(
22 ... 'http://answers.launchpad.dev/firefox/+question/2')22 ... 'http://answers.launchpad.dev/firefox/+question/2')
23 >>> print backslashreplace(user_browser.title)23 >>> print backslashreplace(user_browser.title)
24 Questions : Mozilla Firefox24 Question #2 : ...
2525
26 >>> user_browser.getLink('Link to a FAQ').click()26 >>> user_browser.getLink('Link to a FAQ').click()
27 >>> print backslashreplace(user_browser.title)27 >>> print backslashreplace(user_browser.title)
@@ -279,7 +279,7 @@
279 >>> print owner_browser.url279 >>> print owner_browser.url
280 http://answers.launchpad.dev/firefox/+faq/...280 http://answers.launchpad.dev/firefox/+faq/...
281 >>> print backslashreplace(owner_browser.title)281 >>> print backslashreplace(owner_browser.title)
282 Questions : Mozilla Firefox282 FAQ #12 : Questions : Mozilla Firefox
283283
284The FAQ keywords and content appears just below:284The FAQ keywords and content appears just below:
285285
@@ -320,7 +320,7 @@
320 >>> user_browser.open(320 >>> user_browser.open(
321 ... 'http://answers.launchpad.dev/ubuntu/+question/11')321 ... 'http://answers.launchpad.dev/ubuntu/+question/11')
322 >>> print user_browser.title322 >>> print user_browser.title
323 Questions : Ubuntu323 Question #11 : ...
324 >>> user_browser.getLink('Link to a FAQ').click()324 >>> user_browser.getLink('Link to a FAQ').click()
325 >>> print user_browser.title325 >>> print user_browser.title
326 Is question #11 a FAQ...326 Is question #11 a FAQ...
@@ -328,8 +328,8 @@
328 >>> user_browser.open(328 >>> user_browser.open(
329 ... 'http://answers.launchpad.dev/ubuntu/+source/mozilla-firefox'329 ... 'http://answers.launchpad.dev/ubuntu/+source/mozilla-firefox'
330 ... '/+question/8')330 ... '/+question/8')
331 >>> user_browser.title331 >>> print user_browser.title
332 'Questions : \xe2\x80\x9cmozilla-firefox\xe2\x80\x9d package : Ubuntu'332 Question #8 : ...
333 >>> user_browser.getLink('Link to a FAQ').click()333 >>> user_browser.getLink('Link to a FAQ').click()
334 >>> user_browser.title334 >>> user_browser.title
335 'Is question #8 a FAQ...335 'Is question #8 a FAQ...
@@ -365,8 +365,8 @@
365added to the question, and his message was added to the question's365added to the question, and his message was added to the question's
366discussion.366discussion.
367367
368 >>> user_browser.title368 >>> print user_browser.title
369 'Questions : \xe2\x80\x9cmozilla-firefox\xe2\x80\x9d package : Ubuntu'369 Question #9 : ...
370 >>> print_question_status(user_browser)370 >>> print_question_status(user_browser)
371 Solved...371 Solved...
372372
373373
=== modified file 'lib/lp/bugs/stories/bugs/xx-bug-create-question.txt'
--- lib/lp/bugs/stories/bugs/xx-bug-create-question.txt 2009-09-24 17:25:40 +0000
+++ lib/lp/bugs/stories/bugs/xx-bug-create-question.txt 2009-11-07 04:51:13 +0000
@@ -102,8 +102,8 @@
102No Privileges Person case see that the question was created from a102No Privileges Person case see that the question was created from a
103bug. He uses the link to Related bug to return to the bug.103bug. He uses the link to Related bug to return to the bug.
104104
105 >>> user_browser.title105 >>> print user_browser.title
106 'Questions : \xe2\x80\x9clinux-source-2.6.15\xe2\x80\x9d package : Ubuntu'106 Question #... : Questions : ...linux-source-2.6.15... package : Ubuntu
107107
108 >>> print extract_text(108 >>> print extract_text(
109 ... find_tag_by_id(user_browser.contents, 'original-bug'))109 ... find_tag_by_id(user_browser.contents, 'original-bug'))
@@ -239,7 +239,7 @@
239 ... 'Copy, Cut and Delete operations should work on '239 ... 'Copy, Cut and Delete operations should work on '
240 ... 'selections').click()240 ... 'selections').click()
241 >>> print user_browser.title241 >>> print user_browser.title
242 Questions : Jokosher242 Question #... : Questions : Jokosher
243243
244 >>> print extract_text(244 >>> print extract_text(
245 ... find_tag_by_id(user_browser.contents, 'registration'))245 ... find_tag_by_id(user_browser.contents, 'registration'))