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
=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
--- lib/lp/bugs/interfaces/bugtask.py 2010-02-01 22:47:12 +0000
+++ lib/lp/bugs/interfaces/bugtask.py 2010-02-05 16:36:26 +0000
@@ -823,6 +823,11 @@
823 vocabulary='SourcePackageName')823 vocabulary='SourcePackageName')
824 distribution = Choice(824 distribution = Choice(
825 title=_("Distribution"), required=False, vocabulary='Distribution')825 title=_("Distribution"), required=False, vocabulary='Distribution')
826 tags_combinator = Choice(
827 title=_("Tags combination"),
828 description=_("Search for any or all of the tags specified."),
829 vocabulary=BugTagsSearchCombinator, required=False,
830 default=BugTagsSearchCombinator.ANY)
826831
827832
828class IUpstreamProductBugTaskSearch(IBugTaskSearch):833class IUpstreamProductBugTaskSearch(IBugTaskSearch):
829834
=== modified file 'lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt'
--- lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt 2010-01-23 14:17:49 +0000
+++ lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.txt 2010-02-05 16:36:26 +0000
@@ -14,7 +14,7 @@
1414
15 >>> login("no-priv@canonical.com")15 >>> login("no-priv@canonical.com")
16 >>> firefox = getUtility(IProductSet).get(4)16 >>> firefox = getUtility(IProductSet).get(4)
17 >>> foobar = getUtility(IPersonSet).get(16)17 >>> foobar = getUtility(IPersonSet).getByName("name16")
1818
19The first bug is tagged with both 'test-tag-1' and 'test-tag-2'.19The first bug is tagged with both 'test-tag-1' and 'test-tag-2'.
2020
@@ -45,6 +45,19 @@
45 Summary Importance Status Heat45 Summary Importance Status Heat
46 16 test bug a Undecided New46 16 test bug a Undecided New
47 17 test bug b Undecided New47 17 test bug b Undecided New
48
49Same works for user related bugs:
50
51 >>> anon_browser.open('http://launchpad.dev/~name16/+bugs?advanced=1')
52 >>> anon_browser.getControl(
53 ... name='field.tag').value = 'test-tag-1 test-tag-2'
54 >>> anon_browser.getControl(name='field.tags_combinator').value = ['ANY']
55 >>> anon_browser.getControl('Search', index=1).click()
56 >>> print extract_text(
57 ... find_tag_by_id(anon_browser.contents, 'buglisting'))
58 Summary In Importance Status
59 16 test bug a Mozilla Firefox Undecided New
60 17 test bug b Mozilla Firefox Undecided New
4861
49When we search for bugs with all the tags, though, only the first bug is62When we search for bugs with all the tags, though, only the first bug is
50returned, since it's the only bug with both tags.63returned, since it's the only bug with both tags.
@@ -58,3 +71,15 @@
58 ... find_tag_by_id(anon_browser.contents, 'buglisting'))71 ... find_tag_by_id(anon_browser.contents, 'buglisting'))
59 Summary Importance Status Heat72 Summary Importance Status Heat
60 16 test bug a Undecided New73 16 test bug a Undecided New
74
75And also for user related bugs:
76
77 >>> anon_browser.open('http://launchpad.dev/~name16/+bugs?advanced=1')
78 >>> anon_browser.getControl(
79 ... name='field.tag').value = 'test-tag-1 test-tag-2'
80 >>> anon_browser.getControl(name='field.tags_combinator').value = ['ALL']
81 >>> anon_browser.getControl('Search', index=1).click()
82 >>> print extract_text(
83 ... find_tag_by_id(anon_browser.contents, 'buglisting'))
84 Summary In Importance Status
85 16 test bug a Mozilla Firefox Undecided New