Skip to content

Commit

Permalink
style: quality fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zawan-ila committed Jan 7, 2025
1 parent a6eeaaf commit 9732367
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions course_discovery/apps/api/v1/tests/test_views/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ def test_availability_faceting(self):
['results', 0, 'program_types', 0], ProgramStatus.Unpublished, 5),
(detailed_path,
CourseRunSearchModelSerializer,
['results', 0, 'programs', 0, 'type'], ProgramStatus.Deleted, 21),
['results', 0, 'programs', 0, 'type'], ProgramStatus.Deleted, 22),
(detailed_path,
CourseRunSearchModelSerializer,
['results', 0, 'programs', 0, 'type'], ProgramStatus.Unpublished, 22),
['results', 0, 'programs', 0, 'type'], ProgramStatus.Unpublished, 23),
)
@ddt.unpack
def test_exclude_unavailable_program_types(self, path, serializer, result_location_keys, program_status,
Expand Down Expand Up @@ -599,7 +599,7 @@ def test_results_filtered_by_default_partner(self, short_code):
self.serialize_program_search(other_program),
]

@ddt.data((True, 9), (False, 9))
@ddt.data((True, 10), (False, 10))
@ddt.unpack
def test_query_count_exclude_expired_course_run(self, exclude_expired, expected_queries):
""" Verify that there is no query explosion when excluding expired course runs. """
Expand Down
2 changes: 1 addition & 1 deletion course_discovery/apps/course_metadata/algolia_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def should_index(self):
if self.type.slug == CourseType.EXECUTIVE_EDUCATION_2U and \
self.product_external_status == ExternalProductStatus.Archived:
return False

if self.type.slug in settings.RETIRED_COURSE_TYPES:
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from taxonomy.utils import get_whitelisted_serialized_skills

from course_discovery.apps.api.utils import get_retired_course_type_ids
from course_discovery.apps.course_metadata.models import Course, CourseRun, CourseType
from course_discovery.apps.course_metadata.models import Course, CourseRun
from course_discovery.apps.course_metadata.utils import get_product_skill_names

from .analyzers import case_insensitive_keyword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from course_discovery.apps.api.utils import get_retired_run_type_ids
from course_discovery.apps.course_metadata.choices import CourseRunStatus
from course_discovery.apps.course_metadata.models import CourseRun, CourseRunType
from course_discovery.apps.course_metadata.models import CourseRun
from course_discovery.apps.course_metadata.utils import get_product_skill_names

from .analyzers import case_insensitive_keyword, html_strip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def test_retired_course_indexing(self):
course = self.create_course_with_basic_active_course_run()
course.authoring_organizations.add(OrganizationFactory())
course.type = CourseTypeFactory(slug='audit')
assert course.should_index == False
assert not course.should_index

@ddt.data(
(None, True),
Expand Down

0 comments on commit 9732367

Please sign in to comment.