-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[BD-32] feat: 1st batch of Open edX Events #28266
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| import pytest | ||
| from django.conf import settings | ||
| from django.urls import reverse | ||
| from openedx_events.tests.utils import OpenEdxEventsTestMixin | ||
|
|
||
| from common.djangoapps.course_modes.models import CourseMode | ||
| from common.djangoapps.course_modes.tests.factories import CourseModeFactory | ||
|
|
@@ -30,19 +31,28 @@ | |
| @ddt.ddt | ||
| @patch.dict('django.conf.settings.FEATURES', {'ENABLE_SPECIAL_EXAMS': True}) | ||
| @unittest.skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Test only valid in lms') | ||
| class EnrollmentTest(UrlResetMixin, SharedModuleStoreTestCase): | ||
| class EnrollmentTest(UrlResetMixin, SharedModuleStoreTestCase, OpenEdxEventsTestMixin): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the default behavior for the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This way anyone looking at this as usage example will learn about the existence of the ENABLED_OPENEDX_EVENTS key setting
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great, thanks for the suggestion!
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is the corresponding integration test for when
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, we can make it explicit for the Also any TestCase that does not inherit
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion @nasthagiri! I changed the events tests -e.g. EnrollmentEventsTest-, so they correspond to the integration of each event to the login, registration, and enrollment process. |
||
| """ | ||
| Test student enrollment, especially with different course modes. | ||
| """ | ||
|
|
||
| ENABLED_OPENEDX_EVENTS = [] | ||
|
|
||
| USERNAME = "Bob" | ||
| EMAIL = "bob@example.com" | ||
| PASSWORD = "edx" | ||
| URLCONF_MODULES = ['openedx.core.djangoapps.embargo'] | ||
|
|
||
| @classmethod | ||
| def setUpClass(cls): | ||
| """ | ||
| Set up class method for the Test class. | ||
|
|
||
| This method starts manually events isolation. Explanation here: | ||
| openedx/core/djangoapps/user_authn/views/tests/test_events.py#L44 | ||
| """ | ||
| super().setUpClass() | ||
| cls.start_events_isolation() | ||
| cls.course = CourseFactory.create() | ||
| cls.course_limited = CourseFactory.create() | ||
| cls.proctored_course = CourseFactory( | ||
|
|
||
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.
Love the abstraction layers that are being created for these data objects as part of this effort!