misc: disable "categories" cell (#23240)
gitea-wip/combo/pipeline/pr-main This commit looks good Details

This commit is contained in:
Frédéric Péters 2023-01-03 16:09:30 +01:00
parent 1243c94a1d
commit e1046fa0b8
4 changed files with 11 additions and 1 deletions

View File

@ -792,6 +792,10 @@ class CategoriesCell(WcsDataBaseCell):
self.mark_as_valid()
@classmethod
def is_enabled(cls):
return settings.CATEGORIES_CELL_ENABLED and is_wcs_enabled(cls)
class CardMixin:
invalid_reason_codes = invalid_reason_codes

View File

@ -371,6 +371,8 @@ PWA_NOTIFICATION_ICON_URL = None
BOOKING_CALENDAR_CELL_ENABLED = False
LEGACY_CHART_CELL_ENABLED = False
PUBLIK_FAMILY_CELL_ENABLED = False
CATEGORIES_CELL_ENABLED = False
# and enable others
CHART_FILTERS_CELL_ENABLED = True

View File

@ -1573,7 +1573,7 @@ def test_index_site_num_queries(settings, app):
assert IndexedCell.objects.count() == 50
with CaptureQueriesContext(connection) as ctx:
index_site()
assert len(ctx.captured_queries) in (173, 223) # (3.2, 2.2)
assert len(ctx.captured_queries) in (172, 222) # (3.2, 2.2)
SearchCell.objects.create(
page=page, placeholder='content', order=0, _search_services={'data': ['search1']}

View File

@ -219,6 +219,10 @@ def test_manager_categories_cell(mock_send, settings, app, admin_user):
app = login(app)
resp = app.get('/manage/pages/%s/' % page.pk)
assert not resp.pyquery('[data-tab-slug="general"] select[name$="wcs_site"]')
settings.CATEGORIES_CELL_ENABLED = True
resp = app.get('/manage/pages/%s/' % page.pk)
assert resp.pyquery('[data-tab-slug="general"] select[name$="wcs_site"]')
default = settings.KNOWN_SERVICES['wcs']['default']