def test_filter_by_category(self): d = document(save=True, category=CATEGORIES[1][0]) revision(document=d, save=True) eq_(1, len(kb_overview_rows())) eq_(0, len(kb_overview_rows(category=CATEGORIES[0][0]))) eq_(1, len(kb_overview_rows(category=CATEGORIES[1][0])))
def test_unapproved_articles(self): eq_(0, len(kb_overview_rows())) d = document(save=True) revision(document=d, save=True) eq_(1, len(kb_overview_rows()))
def test_ready_for_l10n(self): d = document(save=True) r = revision(document=d, save=True) d.current_revision = r d.save() data = kb_overview_rows() eq_(1, len(data)) eq_(False, data[0]['ready_for_l10n']) revision(document=d, is_approved=True, is_ready_for_localization=True, save=True) data = kb_overview_rows() eq_(True, data[0]['ready_for_l10n'])
def test_ready_for_l10n(self): d = DocumentFactory() r = RevisionFactory(document=d) d.current_revision = r d.save() data = kb_overview_rows() eq_(1, len(data)) eq_(False, data[0]['ready_for_l10n']) ApprovedRevisionFactory(document=d, is_ready_for_localization=True) data = kb_overview_rows() eq_(True, data[0]['ready_for_l10n'])
def test_ready_for_l10n(self): d = DocumentFactory() r = RevisionFactory(document=d) d.current_revision = r d.save() data = kb_overview_rows() eq_(1, len(data)) eq_(False, data[0]["ready_for_l10n"]) ApprovedRevisionFactory(document=d, is_ready_for_localization=True) data = kb_overview_rows() eq_(True, data[0]["ready_for_l10n"])
def contributors(request): """Render aggregate data about the articles in the default locale.""" product = _get_product(request) category = _get_category(request) return render_readouts( request, CONTRIBUTOR_READOUTS, 'contributors.html', locale=settings.WIKI_DEFAULT_LANGUAGE, product=product, extra_data={ 'overview_rows': kb_overview_rows(locale=request.LANGUAGE_CODE, product=product, mode=smart_int(request.GET.get('mode'), None), max=smart_int(request.GET.get('max'), 10), category=category), 'overview_modes': PERIODS, 'category': category, 'categories': CATEGORIES, })
def contributors_overview(request): product = _get_product(request) category = _get_category(request) return render( request, 'dashboards/contributors_overview.html', { 'overview_rows': kb_overview_rows(locale=request.LANGUAGE_CODE, product=product, mode=smart_int(request.GET.get('mode'), None), max=None, category=category), 'main_dash_view': 'dashboards.contributors', 'main_dash_title': _('Knowledge Base Dashboard'), 'locale': request.LANGUAGE_CODE, 'product': product, 'products': Product.objects.filter(visible=True), 'category': category, 'categories': CATEGORIES })
def contributors_overview_rows(request): product = _get_product(request) overview_rows = kb_overview_rows( locale=request.LANGUAGE_CODE, product=product, mode=smart_int(request.GET.get('mode'), None), max=smart_int(request.GET.get('max'), 10)) return render(request, 'dashboards/includes/kb_overview.html', { 'overview_rows': overview_rows})
def contributors_overview(request): product = _get_product(request) return render(request, 'dashboards/contributors_overview.html', { 'overview_rows': kb_overview_rows( locale=request.LANGUAGE_CODE, product=product, mode=smart_int(request.GET.get('mode'), None), max=None), 'main_dash_view': 'dashboards.contributors', 'main_dash_title': _('Knowledge Base Dashboard'), 'locale': request.LANGUAGE_CODE, 'product': product, 'products': Product.objects.filter(visible=True)})
def contributors_overview_rows(request): product = _get_product(request) overview_rows = kb_overview_rows( locale=request.LANGUAGE_CODE, product=product, mode=smart_int(request.GET.get("mode"), None), max=smart_int(request.GET.get("max"), 10), ) return render( request, "dashboards/includes/kb_overview.html", {"overview_rows": overview_rows} )
def contributors(request): """Render aggregate data about the articles in the default locale.""" product = _get_product(request) return render_readouts( request, CONTRIBUTOR_READOUTS, 'contributors.html', locale=settings.WIKI_DEFAULT_LANGUAGE, product=product, extra_data={ 'overview_rows': kb_overview_rows( locale=request.LANGUAGE_CODE, product=product, mode=smart_int(request.GET.get('mode'), None), max=smart_int(request.GET.get('max'), 10)), 'overview_modes': PERIODS })
def contributors_overview(request): product = _get_product(request) category = _get_category(request) return render( request, "dashboards/contributors_overview.html", { "overview_rows": kb_overview_rows( locale=request.LANGUAGE_CODE, product=product, mode=smart_int(request.GET.get("mode"), None), max=None, category=category, ), "main_dash_view": "dashboards.contributors", "main_dash_title": _("Knowledge Base Dashboard"), "locale": request.LANGUAGE_CODE, "product": product, "products": Product.objects.filter(visible=True), "category": category, "categories": CATEGORIES, }, )
def test_filter_by_category(self): RevisionFactory(document__category=CATEGORIES[1][0]) eq_(1, len(kb_overview_rows())) eq_(0, len(kb_overview_rows(category=CATEGORIES[0][0]))) eq_(1, len(kb_overview_rows(category=CATEGORIES[1][0])))
def test_unapproved_articles(self): eq_(0, len(kb_overview_rows())) RevisionFactory() eq_(1, len(kb_overview_rows()))