Skip to content

Commit f3bd8c8

Browse files
committed
[fix bug 1121209] whatsnew page for ESR24 -> ESR31 updates doesn't show Australis tour
1 parent ed05921 commit f3bd8c8

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

bedrock/firefox/tests/test_base.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,26 @@ def test_fx_35_0_with_wrong_oldversion(self, render_mock):
641641

642642
# end 34.0.5 search tour tests
643643

644+
# ESR31 whatsnew tests
645+
646+
@override_settings(DEV=True)
647+
def test_fx_esr_31_4_0_with_oldversion(self, render_mock):
648+
"""Should use australis tour template for 31.4.0 with old version"""
649+
req = self.rf.get('/en-US/firefox/whatsnew/?oldversion=24.8.0')
650+
self.view(req, version='31.4.0')
651+
template = render_mock.call_args[0][1]
652+
eq_(template, ['firefox/australis/whatsnew-tour.html'])
653+
654+
@override_settings(DEV=True)
655+
def test_fx_esr_31_4_0_with_wrong_oldversion(self, render_mock):
656+
"""Should not show tour for 31.4.0 with wrong old version"""
657+
req = self.rf.get('/en-US/firefox/whatsnew/?oldversion=30.0')
658+
self.view(req, version='31.4.0')
659+
template = render_mock.call_args[0][1]
660+
eq_(template, ['firefox/australis/whatsnew-no-tour.html'])
661+
662+
# end ESR31 whatsnew tests
663+
644664
@override_settings(DEV=True)
645665
def test_rv_prefix(self, render_mock):
646666
"""Prefixed oldversion shouldn't impact version sniffing."""

bedrock/firefox/views.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ def show_devbrowser_firstrun(version):
257257
return False
258258

259259

260+
def show_australis_whatsnew_tour(oldversion):
261+
try:
262+
oldversion = Version(oldversion)
263+
except ValueError:
264+
return False
265+
266+
return oldversion < Version('29.0')
267+
268+
260269
def show_whatsnew_tour(oldversion):
261270
try:
262271
oldversion = Version(oldversion)
@@ -416,7 +425,7 @@ def get_template_names(self):
416425
# old versions of Firefox sent a prefixed version
417426
if oldversion.startswith('rv:'):
418427
oldversion = oldversion[3:]
419-
versions = ('29.', '30.', '31.', '32.')
428+
versions = ('29.', '30.', '32.')
420429

421430
if show_34_0_5_search_template(version):
422431
if locale == 'en-US':
@@ -447,6 +456,12 @@ def get_template_names(self):
447456
template = 'firefox/privacy_tour/no-tour.html'
448457
else:
449458
template = 'firefox/australis/whatsnew-no-tour.html'
459+
# show australis tour for ESR 31 updates
460+
elif version.startswith('31.'):
461+
if show_australis_whatsnew_tour(oldversion):
462+
template = 'firefox/australis/whatsnew-tour.html'
463+
else:
464+
template = 'firefox/australis/whatsnew-no-tour.html'
450465
elif version.startswith(versions):
451466
template = 'firefox/australis/whatsnew-no-tour.html'
452467
elif locale in self.fxos_locales:

0 commit comments

Comments
 (0)