Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Commit

Permalink
[fix bug 1071979] Add Thunderbird product.
Browse files Browse the repository at this point in the history
  • Loading branch information
glogiotatidis committed Oct 6, 2014
1 parent eea6827 commit 3bfb8e4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
21 changes: 17 additions & 4 deletions rna/models.py
Expand Up @@ -31,7 +31,8 @@ def save(self, *args, **kwargs):
class Release(TimeStampedModel):
CHANNELS = ('Nightly', 'Aurora', 'Beta', 'Release', 'ESR')
PRODUCTS = ('Firefox', 'Firefox for Android',
'Firefox Extended Support Release', 'Firefox OS')
'Firefox Extended Support Release', 'Firefox OS',
'Thunderbird')

product = models.CharField(max_length=255,
choices=[(p, p) for p in PRODUCTS])
Expand All @@ -49,14 +50,26 @@ def major_version(self):
return self.version.split('.', 1)[0]

def get_bug_search_url(self):
return self.bug_search_url or (
if self.bug_search_url:
return self.bug_search_url

if self.product == 'Thunderbird':
return (
'https://bugzilla.mozilla.org/buglist.cgi?'
'classification=Client%20Software&query_format=advanced&'
'bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&'
'target_milestone=Thunderbird%20{version}.0&product=Thunderbird'
'&resolution=FIXED'
).format(version=self.major_version())

return (
'https://bugzilla.mozilla.org/buglist.cgi?'
'j_top=OR&f1=target_milestone&o3=equals&v3=Firefox%20{version}&'
'o1=equals&resolution=FIXED&o2=anyexact&query_format=advanced&'
'f3=target_milestone&f2=cf_status_firefox{version}&'
'bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&'
'v1=mozilla{version}&v2=fixed%2Cverified&limit=0'.format(
version=self.major_version()))
'v1=mozilla{version}&v2=fixed%2Cverified&limit=0'
).format(version=self.major_version())

def equivalent_release_for_product(self, product):
"""
Expand Down
12 changes: 12 additions & 0 deletions rna/tests.py
Expand Up @@ -107,6 +107,18 @@ def test_get_bug_search_url_default(self):
'bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&'
'v1=mozilla42&v2=fixed%2Cverified&limit=0')

def test_get_bug_search_url_thunderbird(self):
"""
Should construct based on major version
"""
eq_(models.Release(version='42.0', product='Thunderbird').get_bug_search_url(),
'https://bugzilla.mozilla.org/buglist.cgi?'
'classification=Client%20Software&query_format=advanced&'
'bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&'
'target_milestone=Thunderbird%2042.0&product=Thunderbird'
'&resolution=FIXED'
)

def test_notes(self):
"""
Should split notes into new features and known issues.
Expand Down

0 comments on commit 3bfb8e4

Please sign in to comment.