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