Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[fix bug 1121209] whatsnew page for ESR24 -> ESR31 updates doesn't sh…
- Loading branch information
Showing
with
36 additions
and
1 deletion.
-
+20
−0
bedrock/firefox/tests/test_base.py
-
+16
−1
bedrock/firefox/views.py
|
@@ -641,6 +641,26 @@ def test_fx_35_0_with_wrong_oldversion(self, render_mock): |
|
|
|
|
|
# end 34.0.5 search tour tests |
|
|
|
|
|
# ESR31 whatsnew tests |
|
|
|
|
|
@override_settings(DEV=True) |
|
|
def test_fx_esr_31_4_0_with_oldversion(self, render_mock): |
|
|
"""Should use australis tour template for 31.4.0 with old version""" |
|
|
req = self.rf.get('/en-US/firefox/whatsnew/?oldversion=24.8.0') |
|
|
self.view(req, version='31.4.0') |
|
|
template = render_mock.call_args[0][1] |
|
|
eq_(template, ['firefox/australis/whatsnew-tour.html']) |
|
|
|
|
|
@override_settings(DEV=True) |
|
|
def test_fx_esr_31_4_0_with_wrong_oldversion(self, render_mock): |
|
|
"""Should not show tour for 31.4.0 with wrong old version""" |
|
|
req = self.rf.get('/en-US/firefox/whatsnew/?oldversion=30.0') |
|
|
self.view(req, version='31.4.0') |
|
|
template = render_mock.call_args[0][1] |
|
|
eq_(template, ['firefox/australis/whatsnew-no-tour.html']) |
|
|
|
|
|
# end ESR31 whatsnew tests |
|
|
|
|
|
@override_settings(DEV=True) |
|
|
def test_rv_prefix(self, render_mock): |
|
|
"""Prefixed oldversion shouldn't impact version sniffing.""" |
|
|
|
@@ -257,6 +257,15 @@ def show_devbrowser_firstrun(version): |
|
|
return False |
|
|
|
|
|
|
|
|
def show_australis_whatsnew_tour(oldversion): |
|
|
try: |
|
|
oldversion = Version(oldversion) |
|
|
except ValueError: |
|
|
return False |
|
|
|
|
|
return oldversion < Version('29.0') |
|
|
|
|
|
|
|
|
def show_whatsnew_tour(oldversion): |
|
|
try: |
|
|
oldversion = Version(oldversion) |
|
@@ -416,7 +425,7 @@ def get_template_names(self): |
|
|
# old versions of Firefox sent a prefixed version |
|
|
if oldversion.startswith('rv:'): |
|
|
oldversion = oldversion[3:] |
|
|
versions = ('29.', '30.', '31.', '32.') |
|
|
versions = ('29.', '30.', '32.') |
|
|
|
|
|
if show_34_0_5_search_template(version): |
|
|
if locale == 'en-US': |
|
@@ -447,6 +456,12 @@ def get_template_names(self): |
|
|
template = 'firefox/privacy_tour/no-tour.html' |
|
|
else: |
|
|
template = 'firefox/australis/whatsnew-no-tour.html' |
|
|
# show australis tour for ESR 31 updates |
|
|
elif version.startswith('31.'): |
|
|
if show_australis_whatsnew_tour(oldversion): |
|
|
template = 'firefox/australis/whatsnew-tour.html' |
|
|
else: |
|
|
template = 'firefox/australis/whatsnew-no-tour.html' |
|
|
elif version.startswith(versions): |
|
|
template = 'firefox/australis/whatsnew-no-tour.html' |
|
|
elif locale in self.fxos_locales: |
|
|