def test_funnelcake_id(self): """Button should append funnelcake ID to product in download URL.""" url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'en-US', funnelcake_id='2') ok_('product=firefox-stub-f2&' in url) url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'fr', funnelcake_id='2') ok_('product=firefox-stub-f2&' in url) url = make_download_link('firefox', 'release', 19.0, 'os_osx', 'de', funnelcake_id='23') ok_('product=firefox-19.0-f23&' in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_linux', 'es-ES', funnelcake_id='234') ok_('product=firefox-20.0b4-f234&' in url)
def test_force_stub_installer(self): url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'en-US', force_stub_installer=True) ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'en-US', force_stub_installer=True) ok_('product=firefox-beta-stub&' in url)
def test_force_full_installer_en_us_win_only(self): """ Ensure that force_full_installer doesn't affect non configured locales """ url = make_download_link("firefox", "release", "19.0", "os_osx", "en-US", force_full_installer=True) ok_("product=firefox-latest&" not in url) url = make_download_link("firefox", "beta", "20.0b4", "os_windows", "fr", force_full_installer=True) ok_("product=firefox-beta-latest&" not in url)
def test_stub_installer_en_us_win_only(self): """ Ensure that builds not in the setting don't get stub. """ url = make_download_link("firefox", "release", "19.0", "os_osx", "en-US") ok_("product=firefox-stub&" not in url) url = make_download_link("firefox", "beta", "20.0b4", "os_windows", "fr") ok_("product=firefox-beta-stub&" not in url)
def test_stub_installer_en_us_win_only(self): """ Ensure that builds not in the setting don't get stub. """ url = make_download_link('firefox', 'release', 19.0, 'os_osx', 'en-US') ok_('product=firefox-stub&' not in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'fr') ok_('product=firefox-beta-stub&' not in url)
def test_force_full_installer_en_us_win_only(self): """ Ensure that force_full_installer doesn't affect non configured locales """ url = make_download_link('firefox', 'release', 19.0, 'os_osx', 'en-US', force_full_installer=True) ok_('product=firefox-latest&' not in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'fr', force_full_installer=True) ok_('product=firefox-beta-latest&' not in url)
def test_force_full_installer_en_us_win_only(self): """ Ensure that force_full_installer doesn't affect non configured locales """ url = make_download_link('firefox', 'release', '19.0', 'os_osx', 'en-US', force_full_installer=True) ok_('product=firefox-latest&' not in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'fr', force_full_installer=True) ok_('product=firefox-beta-latest&' not in url)
def test_force_funnelcake(self): """ force_funnelcake should force the product to be 'firefox-latest' for en-US windows release downloads, and 'firefox-beta-latest' for beta. """ url = make_download_link("firefox", "release", "19.0", "os_windows", "en-US", force_funnelcake=True) ok_("product=firefox-latest&" in url) url = make_download_link("firefox", "beta", "20.0b4", "os_windows", "en-US", force_funnelcake=True) ok_("product=firefox-beta-latest&" in url)
def test_force_full_installer(self): """ force_full_installer should force the product to be 'firefox-latest' for configured locale release downloads, and 'firefox-beta-latest' for beta. """ url = make_download_link("firefox", "release", "19.0", "os_windows", "en-US", force_full_installer=True) ok_("product=firefox-latest&" in url) url = make_download_link("firefox", "beta", "20.0b4", "os_windows", "en-US", force_full_installer=True) ok_("product=firefox-beta-latest&" in url)
def test_force_stub_installer_en_us_win_only(self): """ Ensure that force_funnelcake doesn't affect non en-US Windows urls """ url = make_download_link('firefox', 'release', 19.0, 'os_osx', 'en-US', force_stub_installer=True) ok_('product=firefox-stub&' not in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'fr', force_stub_installer=True) ok_('product=firefox-beta-stub&' not in url)
def test_funnelcake_id(self): """Button should append funnelcake ID to product in download URL.""" url = make_download_link("firefox", "release", "19.0", "os_windows", "en-US", funnelcake_id="2") ok_("product=firefox-stub-f2&" in url) url = make_download_link("firefox", "release", "19.0", "os_windows", "fr", funnelcake_id="2") ok_("product=firefox-stub-f2&" in url) url = make_download_link("firefox", "release", "19.0", "os_osx", "de", funnelcake_id="23") ok_("product=firefox-19.0-f23&" in url) url = make_download_link("firefox", "beta", "20.0b4", "os_linux", "es-ES", funnelcake_id="234") ok_("product=firefox-20.0b4-f234&" in url)
def test_force_funnelcake(self): """ force_funnelcake should force the product to be 'firefox-latest' for en-US windows release downloads, and 'firefox-beta-latest' for beta. """ url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'en-US', force_funnelcake=True) ok_('product=firefox-latest&' in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'en-US', force_funnelcake=True) ok_('product=firefox-beta-latest&' in url)
def test_stub_installer_all(self): """Button should give stub for all langs when ALL is set.""" url = make_download_link("firefox", "release", "19.0", "os_windows", "en-US") ok_("product=firefox-stub&" in url) url = make_download_link("firefox", "release", "19.0", "os_windows", "fr") ok_("product=firefox-stub&" in url) url = make_download_link("firefox", "release", "19.0", "os_windows", "de") ok_("product=firefox-stub&" in url) url = make_download_link("firefox", "beta", "20.0b4", "os_windows", "es-ES") ok_("product=firefox-beta-stub&" in url)
def test_force_full_installer(self): """ force_full_installer should force the product to be 'firefox-latest' for configured locale release downloads, and 'firefox-beta-latest' for beta. """ url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'en-US', force_full_installer=True) ok_('product=firefox-latest&' in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'en-US', force_full_installer=True) ok_('product=firefox-beta-latest&' in url)
def test_stub_installer(self): """Button should give stub for builds in the setting always.""" url = make_download_link("firefox", "release", "19.0", "os_windows", "en-US") ok_("product=firefox-stub&" in url) url = make_download_link("firefox", "release", "19.0", "os_osx", "fr") ok_("product=firefox-stub&" in url) url = make_download_link("firefox", "release", "19.0", "os_osx", "de") ok_("product=firefox-stub&" in url) url = make_download_link("firefox", "beta", "20.0b4", "os_windows", "en-US") ok_("product=firefox-beta-stub&" in url)
def test_stub_installer(self): """Button should give stub for builds in the setting always.""" url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'en-US') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'release', 19.0, 'os_osx', 'fr') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'release', 19.0, 'os_osx', 'de') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'en-US') ok_('product=firefox-beta-stub&' in url)
def test_funnelcake_id(self): """Button should append funnelcake ID to product in download URL.""" url = make_download_link('firefox', 'release', '19.0', 'os_windows', 'en-US', funnelcake_id='2') ok_('product=firefox-stub-f2&' in url) url = make_download_link('firefox', 'release', '19.0', 'os_windows', 'fr', funnelcake_id='2') ok_('product=firefox-stub-f2&' in url) url = make_download_link('firefox', 'release', '19.0', 'os_osx', 'de', funnelcake_id='23') ok_('product=firefox-19.0-f23&' in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_linux', 'es-ES', funnelcake_id='234') ok_('product=firefox-20.0b4-f234&' in url)
def test_stub_installer_all(self): """Button should give stub for all langs when ALL is set.""" url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'en-US') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'fr') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'release', 19.0, 'os_windows', 'de') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'beta', '20.0b4', 'os_windows', 'es-ES') ok_('product=firefox-beta-stub&' in url)
def test_download_transition_link_contains_locale(self): """ "transition" download links should include the locale in the path as well as the query string. """ locale = settings.LOCALES_WITH_TRANSITION[0] url = make_download_link('firefox', 'release', 19.0, 'os_osx', locale) good_url = ('/{locale}/products/download.html?product=firefox-19.0&' 'os=osx&lang={locale}').format(locale=locale) eq_(url, good_url)
def test_force_ssl(self): """ Button should append 'SSL' to product in download URL, except the Windows stub installers. """ url = make_download_link('firefox', 'release', '26.0', 'os_windows', 'en-US') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'release', '26.0', 'os_osx', 'en-US') ok_('product=firefox-26.0&' in url) url = make_download_link('firefox', 'release', '26.0', 'os_linux', 'en-US') ok_('product=firefox-26.0&' in url) url = make_download_link('firefox', 'release', '27.0', 'os_windows', 'en-US') ok_('product=firefox-stub&' in url) url = make_download_link('firefox', 'release', '27.0', 'os_osx', 'en-US') ok_('product=firefox-27.0-SSL&' in url) url = make_download_link('firefox', 'release', '27.0', 'os_linux', 'en-US') ok_('product=firefox-27.0-SSL&' in url)