diff --git a/cms/djangoapps/contentstore/transcripts_utils.py b/cms/djangoapps/contentstore/transcripts_utils.py index 48c7d3d690..68f1b29d0d 100644 --- a/cms/djangoapps/contentstore/transcripts_utils.py +++ b/cms/djangoapps/contentstore/transcripts_utils.py @@ -17,7 +17,6 @@ from xmodule.exceptions import NotFoundError from xmodule.contentstore.content import StaticContent from xmodule.contentstore.django import contentstore from xmodule.modulestore import Location -from xmodule.modulestore.inheritance import own_metadata from .utils import get_modulestore diff --git a/cms/djangoapps/contentstore/views/checklist.py b/cms/djangoapps/contentstore/views/checklist.py index aafecc2b0e..352ead8cce 100644 --- a/cms/djangoapps/contentstore/views/checklist.py +++ b/cms/djangoapps/contentstore/views/checklist.py @@ -11,9 +11,6 @@ from django.http import HttpResponseNotFound from django.core.exceptions import PermissionDenied from xmodule.modulestore.django import loc_mapper -from xmodule.modulestore.inheritance import own_metadata - - from ..utils import get_modulestore from .access import has_course_access from xmodule.course_module import CourseDescriptor diff --git a/cms/djangoapps/contentstore/views/course.py b/cms/djangoapps/contentstore/views/course.py index e539edf999..782ea03c3b 100644 --- a/cms/djangoapps/contentstore/views/course.py +++ b/cms/djangoapps/contentstore/views/course.py @@ -20,7 +20,6 @@ from edxmako.shortcuts import render_to_response from xmodule.error_module import ErrorDescriptor from xmodule.modulestore.django import modulestore, loc_mapper -from xmodule.modulestore.inheritance import own_metadata from xmodule.contentstore.content import StaticContent from xmodule.modulestore.exceptions import ( diff --git a/cms/djangoapps/contentstore/views/tabs.py b/cms/djangoapps/contentstore/views/tabs.py index f3291ae928..aa479e2e35 100644 --- a/cms/djangoapps/contentstore/views/tabs.py +++ b/cms/djangoapps/contentstore/views/tabs.py @@ -10,8 +10,6 @@ from django.core.exceptions import PermissionDenied from django_future.csrf import ensure_csrf_cookie from django.views.decorators.http import require_http_methods from edxmako.shortcuts import render_to_response -from xmodule.modulestore import Location -from xmodule.modulestore.inheritance import own_metadata from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import loc_mapper from xmodule.modulestore.locator import BlockUsageLocator diff --git a/cms/djangoapps/contentstore/tests/test_access.py b/cms/djangoapps/contentstore/views/tests/test_access.py similarity index 99% rename from cms/djangoapps/contentstore/tests/test_access.py rename to cms/djangoapps/contentstore/views/tests/test_access.py index 1fbdbdf848..d0918195f8 100644 --- a/cms/djangoapps/contentstore/tests/test_access.py +++ b/cms/djangoapps/contentstore/views/tests/test_access.py @@ -11,6 +11,7 @@ from student.tests.factories import AdminFactory from student.auth import add_users from contentstore.views.access import get_user_role + class RolesTest(TestCase): """ Tests for user roles. diff --git a/cms/djangoapps/contentstore/tests/test_assets.py b/cms/djangoapps/contentstore/views/tests/test_assets.py similarity index 99% rename from cms/djangoapps/contentstore/tests/test_assets.py rename to cms/djangoapps/contentstore/views/tests/test_assets.py index f5a204504d..b4af6f9fb4 100644 --- a/cms/djangoapps/contentstore/tests/test_assets.py +++ b/cms/djangoapps/contentstore/views/tests/test_assets.py @@ -10,7 +10,7 @@ from datetime import datetime from io import BytesIO from pytz import UTC import json -from .utils import CourseTestCase +from contentstore.tests.utils import CourseTestCase from contentstore.views import assets from xmodule.contentstore.content import StaticContent from xmodule.modulestore import Location @@ -114,6 +114,7 @@ class PaginationTestCase(AssetsTestCase): self.assertGreaterEqual(name1, name2) self.assertGreaterEqual(name2, name3) + class UploadTestCase(AssetsTestCase): """ Unit tests for uploading a file diff --git a/cms/djangoapps/contentstore/tests/test_checklists.py b/cms/djangoapps/contentstore/views/tests/test_checklists.py similarity index 98% rename from cms/djangoapps/contentstore/tests/test_checklists.py rename to cms/djangoapps/contentstore/views/tests/test_checklists.py index 90dd40a8b7..aa480a525c 100644 --- a/cms/djangoapps/contentstore/tests/test_checklists.py +++ b/cms/djangoapps/contentstore/views/tests/test_checklists.py @@ -1,12 +1,11 @@ """ Unit tests for checklist methods in views.py. """ from contentstore.utils import get_modulestore from contentstore.views.checklist import expand_checklist_action_url -from xmodule.modulestore.inheritance import own_metadata from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.django import loc_mapper import json -from .utils import CourseTestCase +from contentstore.tests.utils import CourseTestCase class ChecklistTestCase(CourseTestCase): @@ -113,7 +112,6 @@ class ChecklistTestCase(CourseTestCase): self.assertEqual('CourseOutline', get_first_item(persisted_checklist).get('action_url')) self.compare_checklists(persisted_checklist, returned_checklist) - def test_update_checklists_delete_unsupported(self): """ Delete operation is not supported. """ update_url = self.location.url_reverse('checklists/', '100') diff --git a/cms/djangoapps/contentstore/tests/test_course_index.py b/cms/djangoapps/contentstore/views/tests/test_course_index.py similarity index 100% rename from cms/djangoapps/contentstore/tests/test_course_index.py rename to cms/djangoapps/contentstore/views/tests/test_course_index.py index 496b9b7056..4ca23ee43b 100644 --- a/cms/djangoapps/contentstore/tests/test_course_index.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_index.py @@ -9,6 +9,7 @@ from xmodule.modulestore.django import loc_mapper from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore import parsers + class TestCourseIndex(CourseTestCase): """ Unit tests for getting the list of courses and the course outline. @@ -25,7 +26,6 @@ class TestCourseIndex(CourseTestCase): display_name='dotted.course.name-2', ) - def check_index_and_outline(self, authed_client): """ Test getting the list of courses and then pulling up their outlines diff --git a/cms/djangoapps/contentstore/tests/test_course_updates.py b/cms/djangoapps/contentstore/views/tests/test_course_updates.py similarity index 99% rename from cms/djangoapps/contentstore/tests/test_course_updates.py rename to cms/djangoapps/contentstore/views/tests/test_course_updates.py index 38b24d9f53..bc3075668a 100644 --- a/cms/djangoapps/contentstore/tests/test_course_updates.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_updates.py @@ -53,7 +53,6 @@ class CourseUpdateTest(CourseTestCase): content, json.loads(refetched.content)['content'], "get w/ provided id" ) - # now put in an evil update content = '
    ' payload = get_response(content, 'January 11, 2013') diff --git a/cms/djangoapps/contentstore/tests/test_import_export.py b/cms/djangoapps/contentstore/views/tests/test_import_export.py similarity index 98% rename from cms/djangoapps/contentstore/tests/test_import_export.py rename to cms/djangoapps/contentstore/views/tests/test_import_export.py index 85df894cd4..e01e6ba565 100644 --- a/cms/djangoapps/contentstore/tests/test_import_export.py +++ b/cms/djangoapps/contentstore/views/tests/test_import_export.py @@ -12,7 +12,7 @@ import logging from uuid import uuid4 from pymongo import MongoClient -from .utils import CourseTestCase +from contentstore.tests.utils import CourseTestCase from django.test.utils import override_settings from django.conf import settings from xmodule.modulestore.django import loc_mapper @@ -25,6 +25,7 @@ TEST_DATA_CONTENTSTORE['DOC_STORE_CONFIG']['db'] = 'test_xcontent_%s' % uuid4(). log = logging.getLogger(__name__) + @override_settings(CONTENTSTORE=TEST_DATA_CONTENTSTORE) class ImportTestCase(CourseTestCase): """ @@ -178,7 +179,7 @@ class ImportTestCase(CourseTestCase): def try_tar(tarpath): with open(tarpath) as tar: - args = { "name": tarpath, "course-data": [tar] } + args = {"name": tarpath, "course-data": [tar]} resp = self.client.post(self.url, args) self.assertEquals(resp.status_code, 400) self.assertTrue("SuspiciousFileOperation" in resp.content) diff --git a/cms/djangoapps/contentstore/tests/test_item.py b/cms/djangoapps/contentstore/views/tests/test_item.py similarity index 100% rename from cms/djangoapps/contentstore/tests/test_item.py rename to cms/djangoapps/contentstore/views/tests/test_item.py diff --git a/cms/djangoapps/contentstore/tests/test_tabs.py b/cms/djangoapps/contentstore/views/tests/test_tabs.py similarity index 100% rename from cms/djangoapps/contentstore/tests/test_tabs.py rename to cms/djangoapps/contentstore/views/tests/test_tabs.py diff --git a/cms/djangoapps/contentstore/tests/test_textbooks.py b/cms/djangoapps/contentstore/views/tests/test_textbooks.py similarity index 99% rename from cms/djangoapps/contentstore/tests/test_textbooks.py rename to cms/djangoapps/contentstore/views/tests/test_textbooks.py index 7296ab851a..7312d0c70a 100644 --- a/cms/djangoapps/contentstore/tests/test_textbooks.py +++ b/cms/djangoapps/contentstore/views/tests/test_textbooks.py @@ -1,9 +1,7 @@ import json from unittest import TestCase -from .utils import CourseTestCase -from django.core.urlresolvers import reverse +from contentstore.tests.utils import CourseTestCase from contentstore.utils import get_modulestore -from xmodule.modulestore.inheritance import own_metadata from contentstore.views.course import ( validate_textbooks_json, validate_textbook_json, TextbookValidationError) diff --git a/cms/djangoapps/contentstore/tests/test_transcripts.py b/cms/djangoapps/contentstore/views/tests/test_transcripts.py similarity index 96% rename from cms/djangoapps/contentstore/tests/test_transcripts.py rename to cms/djangoapps/contentstore/views/tests/test_transcripts.py index 138b60b513..f92e8e7f21 100644 --- a/cms/djangoapps/contentstore/tests/test_transcripts.py +++ b/cms/djangoapps/contentstore/views/tests/test_transcripts.py @@ -333,17 +333,6 @@ class TestDownloadtranscripts(Basetranscripts): del_cached_content(content_location) return content_location - def remove_subs_from_store(self, subs_id): - """Remove from store, if transcripts content exists.""" - filename = 'subs_{0}.srt.sjson'.format(subs_id) - content_location = StaticContent.compute_location( - self.org, self.number, filename) - try: - content = contentstore().find(content_location) - contentstore().delete(content.get_id()) - except NotFoundError: - pass - def test_success_download_youtube(self): self.item.data = '