mediacloud / news-search-api

Internal API server that offers search access to the Media Cloud Online News Archive (in Elasticsearch).
https://mediacloud.org
GNU Affero General Public License v3.0
1 stars 3 forks source link

ensure `None` publication_dates don't break things #56

Closed rahulbot closed 6 months ago

rahulbot commented 6 months ago

Based on https://github.com/mediacloud/story-indexer/issues/186, we will soon be importing stories that have None as the publication_date value. This change adds some stories like that to the test fixtures, and verifies that they can be searched (by content).

This also changes all results so that None is returned for any field that doesn't have a value, instead of the string "[UKNOWN]" (which seems pretty hard to use as an API client). I don't see this string used anywhere in the API client, so I feel comfortable changing this default to something that I think makes more sense.

rahulbot commented 6 months ago

FYI: I haven't been able to get the API client tests, in mediacloud-news-client, running against this locally. Perhaps some kind of configuration I have wrong? However it looks like that repo's automated test checks out main from here and runs the tests against the fixtures so I'll merge and re-open if those tests fail in a way that requires work here.

rahulbot commented 6 months ago

(integration tests over on mediacloud-news-client all passed)