Merge lp:~thekorn/launchpad/fix-tagcombinator-517570 into lp:launchpad

Proposed by Markus Korn
Status: Merged
Approved by: Guilherme Salgado
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~thekorn/launchpad/fix-tagcombinator-517570
Merge into: lp:launchpad
Diff against target: 64 lines (+31/-1)
2 files modified
lib/lp/bugs/interfaces/bugtask.py (+5/-0)
lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt (+26/-1)
To merge this branch: bzr merge lp:~thekorn/launchpad/fix-tagcombinator-517570
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) code Approve
Review via email: mp+18706@code.launchpad.net

Commit message

Added tags_combinator field to IPersonBugTaskSearch to fix (LP: #517570)

To post a comment you must log in.
Revision history for this message
Markus Korn (thekorn) wrote :

= Summary =

Fix for bug 517570 to make tag_combinator.ALL work again on users bug lists

== Proposed fix ==

Add tags_combinator field to IPersonBugTaskSearch

== Tests ==

% bin/test -vvct xx-searching-by-tags

== 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/interfaces/bugtask.py
  lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt

Revision history for this message
Guilherme Salgado (salgado) wrote :

Looks good to me

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/interfaces/bugtask.py'
2--- lib/lp/bugs/interfaces/bugtask.py 2010-02-01 22:47:12 +0000
3+++ lib/lp/bugs/interfaces/bugtask.py 2010-02-05 16:36:26 +0000
4@@ -823,6 +823,11 @@
5 vocabulary='SourcePackageName')
6 distribution = Choice(
7 title=_("Distribution"), required=False, vocabulary='Distribution')
8+ tags_combinator = Choice(
9+ title=_("Tags combination"),
10+ description=_("Search for any or all of the tags specified."),
11+ vocabulary=BugTagsSearchCombinator, required=False,
12+ default=BugTagsSearchCombinator.ANY)
13
14
15 class IUpstreamProductBugTaskSearch(IBugTaskSearch):
16
17=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt'
18--- lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt 2010-01-23 14:17:49 +0000
19+++ lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt 2010-02-05 16:36:26 +0000
20@@ -14,7 +14,7 @@
21
22 >>> login("no-priv@canonical.com")
23 >>> firefox = getUtility(IProductSet).get(4)
24- >>> foobar = getUtility(IPersonSet).get(16)
25+ >>> foobar = getUtility(IPersonSet).getByName("name16")
26
27 The first bug is tagged with both 'test-tag-1' and 'test-tag-2'.
28
29@@ -45,6 +45,19 @@
30 Summary Importance Status Heat
31 16 test bug a Undecided New
32 17 test bug b Undecided New
33+
34+Same works for user related bugs:
35+
36+ >>> anon_browser.open('http://launchpad.dev/~name16/+bugs?advanced=1')
37+ >>> anon_browser.getControl(
38+ ... name='field.tag').value = 'test-tag-1 test-tag-2'
39+ >>> anon_browser.getControl(name='field.tags_combinator').value = ['ANY']
40+ >>> anon_browser.getControl('Search', index=1).click()
41+ >>> print extract_text(
42+ ... find_tag_by_id(anon_browser.contents, 'buglisting'))
43+ Summary In Importance Status
44+ 16 test bug a Mozilla Firefox Undecided New
45+ 17 test bug b Mozilla Firefox Undecided New
46
47 When we search for bugs with all the tags, though, only the first bug is
48 returned, since it's the only bug with both tags.
49@@ -58,3 +71,15 @@
50 ... find_tag_by_id(anon_browser.contents, 'buglisting'))
51 Summary Importance Status Heat
52 16 test bug a Undecided New
53+
54+And also for user related bugs:
55+
56+ >>> anon_browser.open('http://launchpad.dev/~name16/+bugs?advanced=1')
57+ >>> anon_browser.getControl(
58+ ... name='field.tag').value = 'test-tag-1 test-tag-2'
59+ >>> anon_browser.getControl(name='field.tags_combinator').value = ['ALL']
60+ >>> anon_browser.getControl('Search', index=1).click()
61+ >>> print extract_text(
62+ ... find_tag_by_id(anon_browser.contents, 'buglisting'))
63+ Summary In Importance Status
64+ 16 test bug a Mozilla Firefox Undecided New