diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index f8142af53..2b30343fc 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -23,10 +23,10 @@ jobs: - 5432:5432 steps: - uses: actions/checkout@v2 - - name: Python 3.8 Setup + - name: Python 3.9.5 Setup uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9.5 - name: Install dependencies run: | sudo apt-get update diff --git a/backend/tests/scraper/test_run_scrape.py b/backend/tests/scraper/test_run_scrape.py index dcec8acf8..72a255fc9 100644 --- a/backend/tests/scraper/test_run_scrape.py +++ b/backend/tests/scraper/test_run_scrape.py @@ -55,8 +55,9 @@ def test_add_to_database_existing_in_database( # Assertions cache.get_json.assert_called_once_with(uid, table) - model.create.assert_not_called() - cache.set_json.assert_not_called() + model.delete.assert_called_once() + model.create.assert_called_once() + cache.set_json.assert_called_once() mock_officer_exists.assert_called_once() @@ -65,7 +66,7 @@ def test_add_to_database_new_model( mock_officer_exists: Mock, cache: Mock, model: Mock, uid: str, table: str ): cache.get_json.return_value = None - mock_officer_exists.return_value = False + mock_officer_exists.return_value = model # Calling the function add_to_database(model, cache, uid, table)