def test_non_firefox_redirects(self): callback = is_firefox_redirector('/abide/', '/flout/') url = callback( self.rf.get( '/take/comfort/', HTTP_USER_AGENT='Mozilla Firefox/17.0 Iceweasel/17.0.1')) self.assertEqual(url, '/flout/')
# Bug 979531, 1003727, 979664, 979654, 979660 redirect( r'^firefox/customize/?$', 'https://support.mozilla.org/kb/customize-firefox-controls-buttons-and-toolbars' ), redirect(r'^firefox/(?:performance|happy|speed|memory)/?$', 'firefox.features.fast'), redirect(r'^firefox/security/?$', 'firefox.features.independent'), redirect(r'^firefox/technology/?$', 'https://developer.mozilla.org/docs/Tools'), # Bug 979527 redirect( r'^(products/)?firefox/central(/|\.html|-lite\.html)?$', is_firefox_redirector( 'https://support.mozilla.org/kb/get-started-firefox-overview-main-features', 'firefox.new'), cache_timeout=0), # bug 868169 redirect(r'^mobile/android-download\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox'}, merge_query=True), redirect(r'^mobile/android-download-beta\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox_beta'}, merge_query=True), # bug 675031 redirect(
redirect(r'^firefox/sync/firstrun\.html$', 'firefox.sync'), redirect(r'^firefox/panorama/?$', 'https://support.mozilla.org/kb/tab-groups-organize-tabs'), # Bug 920212 redirect(r'^firefox/fx/?$', 'firefox.new'), # Bug 979670, 979531, 1003727, 979664, 979654, 979660 redirect(r'^firefox/features/?$', 'firefox.desktop.index'), redirect(r'^firefox/customize/?$', 'firefox.desktop.customize'), redirect(r'^firefox/(?:performance|happy|speed|memory)/?$', 'firefox.desktop.fast'), redirect(r'^firefox/security/?$', 'firefox.desktop.trust'), redirect(r'^firefox/technology/?$', 'https://developer.mozilla.org/docs/Tools'), # Bug 979527 redirect(r'^firefox/central/?$', is_firefox_redirector( 'https://support.mozilla.org/kb/get-started-firefox-overview-main-features', 'firefox.new'), vary='user-agent'), # bug 868169 redirect(r'^mobile/android-download\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox'}, merge_query=True), redirect(r'^mobile/android-download-beta\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox_beta'}, merge_query=True), # bug 675031 redirect(r'^projects/fennec(?P<page>/[\/\w\.-]+)?', 'http://website-archive.mozilla.org/www.mozilla.org/fennec_releasenotes/projects/fennec{page}'), # bug 876581
redirect(r'^(products/)?firefox/start/central\.html$', 'firefox.new'), redirect(r'^firefox/sync/firstrun\.html$', 'firefox.sync'), redirect(r'^firefox/panorama/?$', 'https://support.mozilla.org/kb/tab-groups-organize-tabs'), # Bug 920212 redirect(r'^firefox/fx/?$', 'firefox.new'), # Bug 979531, 1003727, 979664, 979654, 979660 redirect(r'^firefox/customize/?$', 'firefox.desktop.customize'), redirect(r'^firefox/(?:performance|happy|speed|memory)/?$', 'firefox.desktop.fast'), redirect(r'^firefox/security/?$', 'firefox.desktop.trust'), redirect(r'^firefox/technology/?$', 'https://developer.mozilla.org/docs/Tools'), # Bug 979527 redirect(r'^(products/)?firefox/central(/|\.html|-lite\.html)?$', is_firefox_redirector( 'https://support.mozilla.org/kb/get-started-firefox-overview-main-features', 'firefox.new'), cache_timeout=0), # bug 868169 redirect(r'^mobile/android-download\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox'}, merge_query=True), redirect(r'^mobile/android-download-beta\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox_beta'}, merge_query=True), # bug 675031 redirect(r'^projects/fennec(?P<page>/[\/\w\.-]+)?', 'http://website-archive.mozilla.org/www.mozilla.org/fennec_releasenotes/projects/fennec{page}'), # bug 876581
# Bug 1110927 redirect(r'^(products/)?firefox/start/central\.html$', 'firefox.new'), redirect(r'^firefox/sync/firstrun\.html$', 'firefox.accounts'), # Bug 920212 redirect(r'^firefox/fx(/.*)?', 'firefox'), # Bug 979531, 1003727, 979664, 979654, 979660 redirect(r'^firefox/customize/?$', 'https://support.mozilla.org/kb/customize-firefox-controls-buttons-and-toolbars'), redirect(r'^firefox/(?:performance|happy|speed|memory)/?$', 'firefox.features.fast'), redirect(r'^firefox/security/?$', 'firefox.features.independent'), redirect(r'^firefox/technology/?$', 'https://developer.mozilla.org/docs/Tools'), # Bug 979527 redirect(r'^(products/)?firefox/central(/|\.html|-lite\.html)?$', is_firefox_redirector( 'https://support.mozilla.org/kb/get-started-firefox-overview-main-features', 'firefox.new'), cache_timeout=0), # bug 868169 redirect(r'^mobile/android-download\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox'}, merge_query=True), redirect(r'^mobile/android-download-beta\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox_beta'}, merge_query=True), # bug 675031 redirect(r'^projects/fennec(?P<page>/[\/\w\.-]+)?', 'http://website-archive.mozilla.org/www.mozilla.org/fennec_releasenotes/projects/fennec{page}'), # bug 876581
def test_non_firefox_redirects(self): callback = is_firefox_redirector('/abide/', '/flout/') url = callback(self.rf.get('/take/comfort/', HTTP_USER_AGENT='Mozilla Firefox/17.0 Iceweasel/17.0.1')) self.assertEqual(url, '/flout/')
def test_non_firefox_redirects(self): callback = is_firefox_redirector("/abide/", "/flout/") url = callback(self.rf.get("/take/comfort/", HTTP_USER_AGENT="Mozilla Firefox/17.0 Iceweasel/17.0.1")) self.assertEqual(url, "/flout/")
redirect(r"^firefox/start/central\.html$", "firefox.new"), redirect(r"^firefox/sync/firstrun\.html$", "firefox.sync"), redirect(r"^firefox/panorama/?$", "https://support.mozilla.org/kb/tab-groups-organize-tabs"), # Bug 920212 redirect(r"^firefox/fx/?$", "firefox.new"), # Bug 979670, 979531, 1003727, 979664, 979654, 979660 redirect(r"^firefox/features/?$", "firefox.desktop.index"), redirect(r"^firefox/customize/?$", "firefox.desktop.customize"), redirect(r"^firefox/(?:performance|happy|speed|memory)/?$", "firefox.desktop.fast"), redirect(r"^firefox/security/?$", "firefox.desktop.trust"), redirect(r"^firefox/technology/?$", "https://developer.mozilla.org/docs/Tools"), # Bug 979527 redirect( r"^firefox/central/?$", is_firefox_redirector( "https://support.mozilla.org/kb/get-started-firefox-overview-main-features", "firefox.new" ), vary="user-agent", ), # bug 868169 redirect( r"^mobile/android-download\.html$", "https://play.google.com/store/apps/details", query={"id": "org.mozilla.firefox"}, merge_query=True, ), redirect( r"^mobile/android-download-beta\.html$", "https://play.google.com/store/apps/details", query={"id": "org.mozilla.firefox_beta"}, merge_query=True,
redirect(r'^firefox/sync/firstrun\.html$', 'firefox.sync'), redirect(r'^firefox/panorama/?$', 'https://support.mozilla.org/kb/tab-groups-organize-tabs'), # Bug 920212 redirect(r'^firefox/fx/?$', 'firefox.new'), # Bug 979670, 979531, 1003727, 979664, 979654, 979660 redirect(r'^firefox/features/?$', 'firefox.desktop.index'), redirect(r'^firefox/customize/?$', 'firefox.desktop.customize'), redirect(r'^firefox/(?:performance|happy|speed|memory)/?$', 'firefox.desktop.fast'), redirect(r'^firefox/security/?$', 'firefox.desktop.trust'), redirect(r'^firefox/technology/?$', 'https://developer.mozilla.org/docs/Tools'), # Bug 979527 redirect(r'^firefox/central/?$', is_firefox_redirector( 'https://support.mozilla.org/kb/get-started-firefox-overview-main-features', 'firefox.new'), cache_timeout=0), # bug 868169 redirect(r'^mobile/android-download\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox'}, merge_query=True), redirect(r'^mobile/android-download-beta\.html$', 'https://play.google.com/store/apps/details', query={'id': 'org.mozilla.firefox_beta'}, merge_query=True), # bug 675031 redirect(r'^projects/fennec(?P<page>/[\/\w\.-]+)?', 'http://website-archive.mozilla.org/www.mozilla.org/fennec_releasenotes/projects/fennec{page}'), # bug 876581