Пример #1
0
    def test_get_download_url_android(self):
        """
        Shoud return the download link for the release.channel from
        android_builds. Note that the channel names are from ship-it, so those
        are different from the internal names like release, beta or alpha.
        """
        store_url = 'https://play.google.com/store/apps/details?id=%s'

        release = Mock(product='Firefox for Android', channel='Release')
        link = views.get_download_url(release)
        assert link.startswith(store_url % 'org.mozilla.firefox')

        release = Mock(product='Firefox for Android', channel='Beta')
        link = views.get_download_url(release)
        assert link.startswith(store_url % 'org.mozilla.firefox_beta')

        release = Mock(product='Firefox for Android', channel='Nightly')
        link = views.get_download_url(release)
        assert link.startswith(store_url % 'org.mozilla.fennec_aurora')
Пример #2
0
    def test_get_download_url_android(self):
        """
        Shoud return the download link for the release.channel from
        android_builds. Note that the channel names are from ship-it, so those
        are different from the internal names like release, beta or alpha.
        """
        store_url = 'https://play.google.com/store/apps/details?id=%s'

        release = Mock(product='Firefox for Android', channel='Release')
        link = views.get_download_url(release)
        ok_(link.startswith(store_url % 'org.mozilla.firefox'))

        release = Mock(product='Firefox for Android', channel='Beta')
        link = views.get_download_url(release)
        ok_(link.startswith(store_url % 'org.mozilla.firefox_beta'))

        release = Mock(product='Firefox for Android', channel='Aurora')
        link = views.get_download_url(release)
        ok_(link.startswith(store_url % 'org.mozilla.fennec_aurora'))
Пример #3
0
 def test_get_download_url_android(self, mock_android_builds):
     """
     Shoud return the download link for the release.channel from
     android_builds
     """
     mock_android_builds.return_value = [{'download_link': '/download'}]
     release = Mock(product='Firefox for Android')
     link = views.get_download_url(release)
     eq_(link, '/download')
     mock_android_builds.assert_called_with(release.channel)
Пример #4
0
 def test_get_download_url_android(self, mock_android_builds):
     """
     Shoud return the download link for the release.channel from
     android_builds
     """
     mock_android_builds.return_value = [{'download_link': '/download'}]
     release = Mock(product='Firefox for Android')
     link = views.get_download_url(release)
     eq_(link, '/download')
     mock_android_builds.assert_called_with(release.channel)
Пример #5
0
 def test_get_download_url_thunderbird_beta(self):
     release = Mock(product='Thunderbird', channel='Beta')
     link = views.get_download_url(release)
     eq_(link, '/en-US/thunderbird/channel/')
Пример #6
0
 def test_get_download_url_thunderbird(self):
     release = Mock(product='Thunderbird')
     link = views.get_download_url(release)
     eq_(link, '/en-US/thunderbird/')
Пример #7
0
 def test_get_download_url_thunderbird_beta(self):
     release = Mock(product='Thunderbird', channel='Beta')
     link = views.get_download_url(release)
     eq_(link, '/en-US/thunderbird/channel/')
Пример #8
0
 def test_get_download_url_thunderbird(self):
     release = Mock(product='Thunderbird')
     link = views.get_download_url(release)
     eq_(link, '/en-US/thunderbird/')
Пример #9
0
 def test_get_download_url_thunderbird(self):
     release = Mock(product='Thunderbird')
     link = views.get_download_url(release)
     eq_(link, 'https://www.mozilla.org/thunderbird/')
Пример #10
0
 def test_get_download_url_thunderbird(self):
     release = Mock(product='Thunderbird')
     with self.activate('en-US'):
         link = views.get_download_url(release)
     eq_(link, '/en-US/thunderbird/')
Пример #11
0
 def test_get_download_url_thunderbird(self):
     release = Mock(product='Thunderbird')
     link = views.get_download_url(release)
     eq_(link, 'https://www.mozilla.org/thunderbird/')
Пример #12
0
 def test_get_download_url_thunderbird(self):
     release = Mock(product='Thunderbird')
     with self.activate('en-US'):
         link = views.get_download_url(release)
     eq_(link, '/en-US/thunderbird/')