def test_other_apps_no_addons(self): """An add-on by the same author should not show up.""" other = Addon.objects.get(id=592) assert other.type != amo.ADDON_WEBAPP, 'Should not be an app.' add_addon_author(other, self.webapp) eq_(self.get_more_pq()('#author-addons').length, 0)
def test_other_apps_no_unlisted(self): """An unlisted app by the same author should not show up.""" Addon.objects.get(id=592).update(type=amo.ADDON_WEBAPP, disabled_by_user=True) other = Webapp.objects.get(id=592) add_addon_author(other, self.webapp) eq_(self.get_more_pq()('#author-addons').length, 0)
def test_other_apps(self): """Ensure listed apps by the same author show up.""" # Create a new webapp. Addon.objects.get(id=592).update(type=amo.ADDON_WEBAPP) other = Webapp.objects.get(id=592) eq_(list(Webapp.objects.listed().exclude(id=self.webapp.id)), [other]) author = add_addon_author(other, self.webapp) doc = self.get_more_pq()('#author-addons') eq_(doc.length, 1) by = doc.find('h2 a') eq_(by.attr('href'), author.get_url_path()) eq_(by.text(), author.name) test_hovercards(self, doc, [other], src='dp-dl-othersby')