Skip to content

Commit

Permalink
Merge pull request #844 from ZeitOnline/WCM-22-cleanup
Browse files Browse the repository at this point in the history
MAINT: Remove long-obsolete automatic type "(solr) query"
  • Loading branch information
wosc authored Sep 9, 2024
2 parents f010740 + e443973 commit f5cbc75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
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 @@ -242,9 +241,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

0 comments on commit f5cbc75

Please sign in to comment.