-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for course enrollment sink
- Loading branch information
Showing
4 changed files
with
23 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
platform_plugin_aspects/sinks/tests/test_course_enrollment_sink.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Test the course enrollment sink module. | ||
""" | ||
|
||
from unittest.mock import patch | ||
|
||
from platform_plugin_aspects.sinks import CourseEnrollmentSink | ||
|
||
|
||
@patch("platform_plugin_aspects.sinks.ModelBaseSink.get_queryset") | ||
def test_get_queryset(mock_get_queryset): | ||
""" | ||
Test the get_queryset method. | ||
""" | ||
sink = CourseEnrollmentSink(None, None) | ||
|
||
sink.get_queryset() | ||
|
||
mock_get_queryset.assert_called_once_with(None) | ||
mock_get_queryset.return_value.select_related.assert_called_once_with("user") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters