Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Remove long-obsolete automatic type "(solr) query" #844

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions core/src/zeit/cms/content/tests/test_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ def test_setting_none_value_deletes_xml_content(self):
from zeit.cms.content.property import ObjectPathProperty

content = ExampleContentType()
prop = ObjectPathProperty('.raw_query', zope.schema.Text(missing_value='missing'))
prop.__set__(content, 'solr!')
prop = ObjectPathProperty('.example', zope.schema.Text(missing_value='missing'))
prop.__set__(content, 'foo')
self.assertEllipsis(
'<raw_query...>solr!</raw_query>', lxml.etree.tostring(content.xml.find('raw_query'))
'<example...>foo</example>', lxml.etree.tostring(content.xml.find('example'))
)
prop.__set__(content, None)
self.assertEqual(content.xml.findall('raw_query'), [])
self.assertEqual(content.xml.findall('example'), [])
4 changes: 2 additions & 2 deletions core/src/zeit/content/cp/browser/tests/test_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def test_edit_form_stores_custom_query(self):
b = self.browser
b.open(self.get_edit_area_link())
edit_url = b.url
b.getControl(name='form.automatic_type').displayValue = ['automatic-area-type-query']
b.getControl(name='form.automatic_type').displayValue = ['automatic-area-type-custom']
b.getControl('Amount of teasers').value = '1'
b.getControl('Add Custom Query').click()
b.getControl('Custom Query Type').displayValue = ['query-type-serie']
Expand Down Expand Up @@ -166,7 +166,7 @@ def test_edit_form_stores_custom_query(self):
def test_removes_mismatched_custom_query_value_on_type_change(self):
b = self.browser
b.open(self.get_edit_area_link())
b.getControl(name='form.automatic_type').displayValue = ['automatic-area-type-query']
b.getControl(name='form.automatic_type').displayValue = ['automatic-area-type-custom']
b.getControl('Amount of teasers').value = '1'
b.getControl('Add Custom Query').click()
b.getControl('Channel').displayValue = ['International']
Expand Down
4 changes: 0 additions & 4 deletions core/src/zeit/content/cp/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ class AutomaticTypeSource(zeit.cms.content.sources.SimpleDictSource):
('custom', _('automatic-area-type-custom')),
('topicpage', _('automatic-area-type-topicpage')),
('related-topics', _('automatic-area-type-related-topics')),
('query', _('automatic-area-type-query')),
('elasticsearch-query', _('automatic-area-type-elasticsearch-query')),
('reach', _('automatic-area-type-reach')),
('topicpagelist', _('automatic-area-type-topicpagelist')),
Expand All @@ -241,9 +240,6 @@ def automatic_area_can_read_teasers_automatically(data):
if data.automatic_type == 'related-topics' and data.related_topicpage:
return True

if data.automatic_type == 'query' and data.raw_query:
return True

if data.automatic_type == 'elasticsearch-query' and data.elasticsearch_raw_query:
return True

Expand Down