diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1a9a0c8..e1db1a84 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ jobs: - name: Add hosts run: echo "127.0.0.1 pmg.test" | sudo tee -a /etc/hosts - name: Run tests - run: docker compose -f docker-compose.yml -f docker-compose-test.yml run --rm web nosetests --with-coverage tests + run: docker compose -f docker-compose.yml -f docker-compose-test.yml run --rm web nosetests --with-coverage --cover-package=pmg tests - name: Setup Dev Database run: docker compose run --rm web python setup_dev_database.py - name: Setup the database Stamp Head diff --git a/pmg/search.py b/pmg/search.py index 9a599952..8789cbed 100644 --- a/pmg/search.py +++ b/pmg/search.py @@ -477,11 +477,11 @@ def search( "gauss": { "date": { # Scores must decay, starting at docs from 7 days ago - # such that docs 30 days ago are at 0.6. + # such that docs 30 days ago are at 0.3. # See https://www.elastic.co/blog/found-function-scoring "offset": "7d", "scale": "30d", - "decay": 0.6, + "decay": 0.3, } }, # Only apply decay to documents that have a date field. diff --git a/tests/unit/test_search.py b/tests/unit/test_search.py index aac25ae6..17adbfd9 100644 --- a/tests/unit/test_search.py +++ b/tests/unit/test_search.py @@ -102,7 +102,7 @@ def test_serialise_post(self): assert_in("Blog post header", data["fulltext"]) assert_not_in("

", data["fulltext"]) assert_equals(post.slug, data["slug"]) - assert_equals(post.date, data["date"]) + assert_equals(post.date.isoformat(), data["date"]) def create_post(self): post = Post()