From 4651b429ef9ca54f47212f4fdf7029253550d98d Mon Sep 17 00:00:00 2001 From: Awais Qureshi Date: Mon, 4 Dec 2023 18:30:56 +0500 Subject: [PATCH] chore: fixing tests. --- repo_health/check_django_dependencies_compatibility.py | 5 +++-- requirements/constraints.txt | 5 +---- tests/data/mock_django_dependencies_sheet.csv | 2 +- tests/test_check_django_deps.py | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/repo_health/check_django_dependencies_compatibility.py b/repo_health/check_django_dependencies_compatibility.py index 48dc1fb8..032184c1 100644 --- a/repo_health/check_django_dependencies_compatibility.py +++ b/repo_health/check_django_dependencies_compatibility.py @@ -147,8 +147,9 @@ def get_upgraded_dependencies_count(repo_path, django_dependency_sheet) -> tuple package_name = line["Django Package Name"] if package_name in deps.keys(): # pylint: disable=consider-iterating-dictionary django_deps.append(package_name) - - if line["Django 3.2"] and line["Django 3.2"] != '-': + # If the package support is included in the master branch but hasn't been released, + # it won't be regarded as a supported version. + if line["Django 3.2"] and line["Django 3.2"] not in ['-', 'master']: deps_support_django32.append(package_name) if parse(deps[package_name]) >= parse(line["Django 3.2"]): diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 491ee8b7..fe7a7072 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -12,9 +12,6 @@ # This file contains all common constraints for edx-repos -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt -# greater version breaking test. -packaging==21.3 - -# gspread==5.12.0 contains breaking changes +# gspread==5.12.0 contains breaking changes # which break the scheduled repo health job gspread<5.12.0 diff --git a/tests/data/mock_django_dependencies_sheet.csv b/tests/data/mock_django_dependencies_sheet.csv index 29ec9770..39656baa 100644 --- a/tests/data/mock_django_dependencies_sheet.csv +++ b/tests/data/mock_django_dependencies_sheet.csv @@ -3,5 +3,5 @@ 40,edx-opaque-keys,yes,-,2.2.0,2.2.0,-,"Feb 1, 2021",,, 103,django-storages,,1.11,1.8,1.1,-,"Jun 21, 2021",https://github.com/edx/upgrades/issues/44,, 110,edx-django-utils,yes,-,master,4.2.0,4.2.0,"Jul 14, 2021",BOM-2634,, -30,djangorestframework,,3.12.3,3.11.0,3.12.0,p,"Jun 30, 2021",,,3.12.4 +30,djangorestframework,,3.12.3,3.11.0,3.12.0,4.2,"Jun 30, 2021",,,3.12.4 29,django-waffle,,2.2.0,0.19.0,2.0.0,-,"May 22, 2021",,, diff --git a/tests/test_check_django_deps.py b/tests/test_check_django_deps.py index 016cae58..f9c93610 100644 --- a/tests/test_check_django_deps.py +++ b/tests/test_check_django_deps.py @@ -31,7 +31,7 @@ def test_django_deps_upgrade(repo_path): assert 'edx-django-utils' in all_results[MODULE_DICT_KEY]['django_32']['list'] assert 'edx-django-utils' not in all_results[MODULE_DICT_KEY]['upgraded']['list'] - assert 'djangorestframework' in all_results[MODULE_DICT_KEY]['upgraded']['list'] + assert 'djangorestframework' not in all_results[MODULE_DICT_KEY]['upgraded']['list'] @pytest.mark.parametrize("repo_path", [get_repo_path("js_repo")])