# bug 1051686 redirect(r'^ja/firefox/organizations/?$', 'https://www.mozilla.jp/business/', locale_prefix=False), # bug 874913 redirect(r'products/download.html', 'firefox.new', query=''), # bug 845580 redirect(r'^home/?$', 'firefox.new'), # bug 948605 redirect(r'^firefox/xp', 'firefox.new'), # bug 875052 redirect(r'^start/', ua_redirector('seamonkey', 'http://www.seamonkey-project.org/start/', 'firefox.new'), cache_timeout=0), # bug 856081 redirect /about/drivers https://wiki.mozilla.org/Firefox/Drivers redirect(r'^about/drivers(\.html|/)?$', 'https://wiki.mozilla.org/Firefox/Drivers'), # community # bug 885797 redirect(r'^community/(directory|wikis|blogs|websites)\.html$', 'https://wiki.mozilla.org/Websites/Directory', locale_prefix=False), # bug 885856 redirect(r'^projects/index\.(de|fr|hr|sq).html$', '/{}/firefox/products/', locale_prefix=False), # bug 856075
'https://www.mozilla.jp/business/', locale_prefix=False), # bug 874913, 681572 redirect(r'^(products/)?download\.html', 'firefox.new', query=''), # bug 845580 redirect(r'^home/?$', 'firefox.new'), # bug 948605 redirect(r'^firefox/xp', 'firefox.new'), # bug 875052 redirect(r'^start/', ua_redirector('seamonkey', 'http://www.seamonkey-project.org/start/', 'firefox.new'), cache_timeout=0), # bug 856081 redirect /about/drivers https://wiki.mozilla.org/Firefox/Drivers redirect(r'^about/drivers(\.html|/)?$', 'https://wiki.mozilla.org/Firefox/Drivers'), # community # bug 885797 redirect(r'^community/(directory|wikis|blogs|websites)\.html$', 'https://wiki.mozilla.org/Websites/Directory', locale_prefix=False), # bug 885856 redirect(r'^projects/index\.(de|fr|hr|sq).html$',
# bug 874913 redirect('products/download.html', 'firefox.new', anchor='download-fx'), # bug 845580 redirect('^home/?$', 'firefox.new'), # bug 948605 redirect('^firefox/xp', 'firefox.new'), # bug 857246 redirect /products/firefox/start/ to start.mozilla.org redirect('^products/firefox/start/?$', 'http://start.mozilla.org'), # bug 875052 redirect('^start/', ua_redirector('seamonkey', 'http://www.seamonkey-project.org/start/', 'firefox.new'), vary='User-Agent'), # bug 856081 redirect /about/drivers https://wiki.mozilla.org/Firefox/Drivers redirect('^about/drivers(\.html|/)?$', 'https://wiki.mozilla.org/Firefox/Drivers'), # community # bug 885797 redirect('^community/(directory|wikis|blogs|websites)\.html$', 'https://wiki.mozilla.org/Websites/Directory', locale_prefix=False), # bug 885856 redirect('^projects/index\.(de|fr|hr|sq).html$', '/{}/firefox/products/', locale_prefix=False), # bug 856075
'utm_medium': 'referral', 'utm_source': 'mozilla.org' }), # bug 874913, 681572 redirect(r'^(products/)?download\.html', 'firefox.new', query=''), # bug 845580 redirect(r'^home/?$', 'firefox.new'), # bug 948605 redirect(r'^firefox/xp', 'firefox.new'), # bug 875052 redirect(r'^start/', ua_redirector('seamonkey', 'http://www.seamonkey-project.org/start/', 'firefox.new'), cache_timeout=0), # bug 856081 redirect /about/drivers https://wiki.mozilla.org/Firefox/Drivers redirect(r'^about/drivers(\.html|/)?$', 'https://wiki.mozilla.org/Firefox/Drivers'), # community # bug 885797 redirect(r'^community/(directory|wikis|blogs|websites)\.html$', 'https://wiki.mozilla.org/Websites/Directory', locale_prefix=False), # bug 885856 redirect(r'^projects/index\.(de|fr|hr|sq)\.html$', '/{}/firefox/', locale_prefix=False), # bug 856075
def test_ua_redirector(self): callback = ua_redirector('dude', '/abide/', '/flout/') url = callback(self.rf.get('/take/comfort/', HTTP_USER_AGENT='the dude browses')) self.assertEqual(url, '/abide/')
def test_ua_redirector(self): callback = ua_redirector("dude", "/abide/", "/flout/") url = callback(self.rf.get("/take/comfort/", HTTP_USER_AGENT="the dude browses")) self.assertEqual(url, "/abide/")
"https://www.firefox.com.cn/", locale_prefix=False, query={ "utm_medium": "referral", "utm_source": "mozilla.org" }), # bug 874913, 681572 redirect(r"^(products/)?download\.html", "firefox.new", query=""), # bug 845580 redirect(r"^home/?$", "firefox.new"), # bug 948605 redirect(r"^firefox/xp", "firefox.new"), # bug 875052 redirect(r"^start/", ua_redirector("seamonkey", "http://www.seamonkey-project.org/start/", "firefox.new"), cache_timeout=0), # bug 856081 redirect /about/drivers https://wiki.mozilla.org/Firefox/Drivers redirect(r"^about/drivers(\.html|/)?$", "https://wiki.mozilla.org/Firefox/Drivers"), # community # bug 885797 redirect(r"^community/(directory|wikis|blogs|websites)\.html$", "https://wiki.mozilla.org/Websites/Directory", locale_prefix=False), # bug 885856 redirect(r"^projects/index\.(de|fr|hr|sq)\.html$", "/{}/firefox/", locale_prefix=False), # bug 856075
# bug 874913 redirect(r'products/download.html', 'firefox.new', anchor='download-fx'), # bug 845580 redirect(r'^home/?$', 'firefox.new'), # bug 948605 redirect(r'^firefox/xp', 'firefox.new'), # bug 857246 redirect /products/firefox/start/ to start.mozilla.org redirect(r'^products/firefox/start/?$', 'http://start.mozilla.org'), # bug 875052 redirect(r'^start/', ua_redirector('seamonkey', 'http://www.seamonkey-project.org/start/', 'firefox.new'), vary='User-Agent'), # bug 856081 redirect /about/drivers https://wiki.mozilla.org/Firefox/Drivers redirect(r'^about/drivers(\.html|/)?$', 'https://wiki.mozilla.org/Firefox/Drivers'), # community # bug 885797 redirect(r'^community/(directory|wikis|blogs|websites)\.html$', 'https://wiki.mozilla.org/Websites/Directory', locale_prefix=False), # bug 885856 redirect(r'^projects/index\.(de|fr|hr|sq).html$', '/{}/firefox/products/', locale_prefix=False), # bug 856075
# bug 1013082 redirect("^ja/?$", "http://www.mozilla.jp/", locale_prefix=False), # bug 1051686 redirect("^ja/firefox/organizations/?$", "http://www.mozilla.jp/business/downloads/", locale_prefix=False), # bug 874913 redirect("products/download.html", "firefox.new", anchor="download-fx"), # bug 845580 redirect("^home/?$", "firefox.new"), # bug 948605 redirect("^firefox/xp", "firefox.new"), # bug 857246 redirect /products/firefox/start/ to start.mozilla.org redirect("^products/firefox/start/?$", "http://start.mozilla.org"), # bug 875052 redirect( "^start/", ua_redirector("seamonkey", "http://www.seamonkey-project.org/start/", "firefox.new"), vary="User-Agent", ), # bug 856081 redirect /about/drivers https://wiki.mozilla.org/Firefox/Drivers redirect("^about/drivers(\.html|/)?$", "https://wiki.mozilla.org/Firefox/Drivers"), # community # bug 885797 redirect( "^community/(directory|wikis|blogs|websites)\.html$", "https://wiki.mozilla.org/Websites/Directory", locale_prefix=False, ), # bug 885856 redirect("^projects/index\.(de|fr|hr|sq).html$", "/{}/firefox/products/", locale_prefix=False), # bug 856075 redirect(