Permalink
Browse files

[fix bug 1121209] whatsnew page for ESR24 -> ESR31 updates doesn't sh…

…ow Australis tour
  • Loading branch information...
1 parent ed05921 commit f3bd8c87d7cbc5cbad8c61e2f1ac05d6c6ea1fed @alexgibson alexgibson committed Jan 14, 2015
Showing with 36 additions and 1 deletion.
  1. +20 −0 bedrock/firefox/tests/test_base.py
  2. +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:

0 comments on commit f3bd8c8

Please sign in to comment.