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_funnelcake(self):
        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_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_force_full_installer(self):
        """
        force_full_installer 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_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_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_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_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_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_full_installer(self):
        """
        force_full_installer 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_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(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)