forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: refactors tests so shared data can be re-used
- Loading branch information
1 parent
ee5bc3d
commit 35bc860
Showing
3 changed files
with
49 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,14 +4,13 @@ | |
|
||
from __future__ import annotations | ||
|
||
import abc | ||
import json | ||
from io import BytesIO | ||
from urllib.parse import parse_qs, urlparse | ||
from unittest.mock import MagicMock | ||
from urllib.parse import parse_qs, urlparse | ||
|
||
import abc | ||
import ddt | ||
from common.djangoapps.student.tests.factories import UserFactory | ||
from django.contrib.auth import get_user_model | ||
from django.core.files.uploadedfile import SimpleUploadedFile | ||
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator | ||
|
@@ -29,13 +28,10 @@ | |
OrgContentCreatorRole, | ||
OrgInstructorRole, | ||
OrgLibraryUserRole, | ||
OrgStaffRole, | ||
) | ||
from openedx.core.djangoapps.content_libraries.api import ( | ||
AccessLevel, | ||
create_library, | ||
set_library_user_permissions, | ||
OrgStaffRole | ||
) | ||
from common.djangoapps.student.tests.factories import UserFactory | ||
from openedx.core.djangoapps.content_libraries.api import AccessLevel, create_library, set_library_user_permissions | ||
from openedx.core.djangoapps.content_tagging import api as tagging_api | ||
from openedx.core.djangoapps.content_tagging.models import TaxonomyOrg | ||
from openedx.core.djangolib.testing.utils import skip_unless_cms | ||
|
@@ -1637,6 +1633,7 @@ class TestContentObjectChildrenExportView(TaggedCourseMixin, APITestCase): # ty | |
""" | ||
def setUp(self): | ||
super().setUp() | ||
self.user = UserFactory.create() | ||
self.staff = UserFactory.create( | ||
username="staff", | ||
email="[email protected]", | ||
|
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