Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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
Beispiel #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
Beispiel #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
Beispiel #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'))
Beispiel #9
0
 def test_basic(self):
     res = self.client.get(reverse('commonplace.iframe-install'))
     eq_(res.status_code, 200)
Beispiel #10
0
 def get_absolute_url(self):
     return reverse('comm-attachment-detail', args=[self.note_id, self.pk])
Beispiel #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'))
Beispiel #12
0
 def test_basic(self):
     res = self.client.get(reverse('commonplace.iframe-install'))
     eq_(res.status_code, 200)
Beispiel #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'))
Beispiel #14
0
 def setUp(self):
     self.iframe_install_url = reverse('commonplace.iframe-install')
     self.potatolytics_url = reverse('commonplace.potatolytics')
Beispiel #15
0
 def test_bad_repo(self):
     res = self.client.get(reverse('commonplace.appcache'),
                           {'repo': 'rocketfuel'})
     eq_(res.status_code, 404)
Beispiel #16
0
 def test_basic(self):
     self._test_url(reverse('commonplace.iframe-install'))
     self._test_url(reverse('commonplace.potatolytics'))
Beispiel #17
0
 def get_absolute_url(self):
     return reverse('reviewers.apps.review.attachment', args=[self.pk])
Beispiel #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'))
Beispiel #19
0
 def setUp(self):
     self.iframe_install_url = reverse('commonplace.iframe-install')
     self.potatolytics_url = reverse('commonplace.potatolytics')
Beispiel #20
0
 def get_absolute_url(self):
     return reverse('comm-attachment-detail', args=[self.note_id, self.pk])
Beispiel #21
0
 def test_no_repo(self):
     res = self.client.get(reverse('commonplace.appcache'))
     eq_(res.status_code, 404)