-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: include restricted runs in algolia objects #976
Conversation
9d40ef7
to
0d00393
Compare
@@ -1746,74 +1755,136 @@ def mock_replace_all_objects(products_iterable): | |||
assert expected_call_args == self._sort_tags_in_algolia_object_list(actual_call_args) | |||
|
|||
@mock.patch('enterprise_catalog.apps.api.tasks.get_initialized_algolia_client', return_value=mock.MagicMock()) | |||
# pylint: disable=too-many-statements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github really fudged this diff view. If you look at the file directly I only added two tests:
- test_index_algolia_restricted_runs_mixed_course
- test_index_algolia_restricted_runs_unicorn_course
0d00393
to
bfa9099
Compare
# catalog queries that explicitly allow runs in those courses. We can tell that a course | ||
# has only restricted runs simply by checking that it normally doesn't have an | ||
# advertised run. | ||
# pylint: disable=protected-access |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you could add an advertised_course_run_uuid()
property to ContentMetadata
to avoid this protected-access warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'm not sure that kind of getter design is sufficiently explicit when there's potentially two options: the values from _json_metadata vs. json_metadata, especially when I expect the value to differ depending on which is queried. My preference is to keep this as written and elaborate on the code comment.
bfa9099
to
feec4a4
Compare
feec4a4
to
b6bfbb3
Compare
ENT-9505
Important features: