Exemple #1
0
 def test_detail(self):
     app = amo.tests.app_factory(description='Awesome')
     res = self.client.get(reverse('detail', args=[app.app_slug]))
     title, image, description = self._get_tags(res)
     eq_(title, app.name)
     eq_(image, app.get_icon_url(64))
     eq_(description, app.description)
Exemple #2
0
    def test_bad_repo(self):
        if 'fireplace' not in settings.COMMONPLACE_REPOS_APPCACHED:
            raise SkipTest

        res = self.client.get(reverse('commonplace.appcache'),
                              {'repo': 'rocketfuel'})
        eq_(res.status_code, 404)
Exemple #3
0
 def test_detail(self):
     app = amo.tests.app_factory(description='Awesome')
     res = self.client.get(reverse('detail', args=[app.app_slug]))
     title, image, description = self._get_tags(res)
     eq_(title, app.name)
     eq_(image, app.get_icon_url(64))
     eq_(description, app.description)
Exemple #4
0
    def test_bad_repo(self):
        if 'fireplace' not in settings.COMMONPLACE_REPOS_APPCACHED:
            raise SkipTest

        res = self.client.get(reverse('commonplace.appcache'),
                              {'repo': 'transonic'})
        eq_(res.status_code, 404)
Exemple #5
0
 def test_good_repo(self, get_imgurls_mock):
     img = '/media/img/icons/eggs/h1.gif'
     get_imgurls_mock.return_value = [img]
     res = self.client.get(reverse('commonplace.appcache'),
                           {'repo': 'fireplace'})
     eq_(res.status_code, 200)
     assert '# BUILD_ID p00p' in res.content
     img = img.replace('/media/', '/media/fireplace/')
     assert img + '\n' in res.content
Exemple #6
0
    def test_good_repo(self, get_imgurls_mock):
        if 'fireplace' not in settings.COMMONPLACE_REPOS_APPCACHED:
            raise SkipTest

        img = '/media/img/icons/eggs/h1.gif'
        get_imgurls_mock.return_value = [img]
        res = self._test_url(reverse('commonplace.appcache'),
                             {'repo': 'fireplace'})
        eq_(res.status_code, 200)
        assert '# BUILD_ID p00p' in res.content
        img = img.replace('/media/', '/media/fireplace/')
        assert img + '\n' in res.content
Exemple #7
0
    def test_good_repo(self, get_imgurls_mock):
        if 'fireplace' not in settings.COMMONPLACE_REPOS_APPCACHED:
            raise SkipTest

        img = '/media/img/icons/eggs/h1.gif'
        get_imgurls_mock.return_value = [img]
        res = self._test_url(reverse('commonplace.appcache'),
                             {'repo': 'fireplace'})
        eq_(res.status_code, 200)
        assert '# BUILD_ID p00p' in res.content
        img = img.replace('/media/', '/media/fireplace/')
        assert img + '\n' in res.content
Exemple #8
0
 def test_detail_dne(self):
     res = self.client.get(reverse('detail', args=['DO NOT EXISTS']))
     title, image, description = self._get_tags(res)
     eq_(title, 'Firefox Marketplace')
     ok_(description.startswith('The Firefox Marketplace is'))
Exemple #9
0
 def test_basic(self):
     res = self.client.get(reverse('commonplace.iframe-install'))
     eq_(res.status_code, 200)
Exemple #10
0
 def get_absolute_url(self):
     return reverse('comm-attachment-detail', args=[self.note_id, self.pk])
Exemple #11
0
 def test_detail_dne(self):
     res = self.client.get(reverse('detail', args=['DO NOT EXISTS']))
     title, image, description = self._get_tags(res)
     eq_(title, 'Firefox Marketplace')
     ok_(description.startswith('The Firefox Marketplace is'))
Exemple #12
0
 def test_basic(self):
     res = self.client.get(reverse('commonplace.iframe-install'))
     eq_(res.status_code, 200)
Exemple #13
0
 def test_basic(self):
     res = self.client.get(reverse('commonplace.fireplace'))
     title, image, description = self._get_tags(res)
     eq_(title, 'Firefox Marketplace')
     ok_(description.startswith('The Firefox Marketplace is'))
Exemple #14
0
 def setUp(self):
     self.iframe_install_url = reverse('commonplace.iframe-install')
     self.potatolytics_url = reverse('commonplace.potatolytics')
Exemple #15
0
 def test_bad_repo(self):
     res = self.client.get(reverse('commonplace.appcache'),
                           {'repo': 'rocketfuel'})
     eq_(res.status_code, 404)
Exemple #16
0
 def test_basic(self):
     self._test_url(reverse('commonplace.iframe-install'))
     self._test_url(reverse('commonplace.potatolytics'))
Exemple #17
0
 def get_absolute_url(self):
     return reverse('reviewers.apps.review.attachment', args=[self.pk])
Exemple #18
0
 def test_basic(self):
     res = self.client.get(reverse('commonplace.fireplace'))
     title, image, description = self._get_tags(res)
     eq_(title, 'Firefox Marketplace')
     ok_(description.startswith('The Firefox Marketplace is'))
Exemple #19
0
 def setUp(self):
     self.iframe_install_url = reverse('commonplace.iframe-install')
     self.potatolytics_url = reverse('commonplace.potatolytics')
Exemple #20
0
 def get_absolute_url(self):
     return reverse('comm-attachment-detail', args=[self.note_id, self.pk])
Exemple #21
0
 def test_no_repo(self):
     res = self.client.get(reverse('commonplace.appcache'))
     eq_(res.status_code, 404)