Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
649e45b4
Commit
649e45b4
authored
Mar 18, 2015
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7388 from edx/ned/remove-more-test-data-mock-modulestore
Remove useless override_settings of MODULESTORE
parents
b66a128c
425b7669
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
25 deletions
+5
-25
common/djangoapps/external_auth/tests/test_ssl.py
+1
-3
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
+1
-6
lms/djangoapps/courseware/tests/test_courses.py
+3
-9
lms/djangoapps/django_comment_client/base/tests.py
+0
-4
lms/djangoapps/instructor/tests/test_api.py
+0
-3
No files found.
common/djangoapps/external_auth/tests/test_ssl.py
View file @
649e45b4
...
...
@@ -21,7 +21,6 @@ from student.models import CourseEnrollment
from
student.roles
import
CourseStaffRole
from
student.tests.factories
import
UserFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MOCK_MODULESTORE
from
xmodule.modulestore.tests.factories
import
CourseFactory
FEATURES_WITH_SSL_AUTH
=
settings
.
FEATURES
.
copy
()
...
...
@@ -319,8 +318,7 @@ class SSLClientTest(ModuleStoreTestCase):
self
.
assertTrue
(
self
.
mock
.
called
)
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
'Test only valid in lms'
)
@override_settings
(
FEATURES
=
FEATURES_WITH_SSL_AUTH_AUTO_ACTIVATE
,
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
)
@override_settings
(
FEATURES
=
FEATURES_WITH_SSL_AUTH_AUTO_ACTIVATE
)
def
test_ssl_lms_redirection
(
self
):
"""
Auto signup auth user and ensure they return to the original
...
...
common/lib/xmodule/xmodule/modulestore/tests/django_utils.py
View file @
649e45b4
...
...
@@ -196,11 +196,6 @@ TEST_DATA_SPLIT_MODULESTORE = mixed_store_config(
store_order
=
[
StoreConstructors
.
split
,
StoreConstructors
.
draft
]
)
# Unit tests that are not specifically testing the modulestore implementation but just need course context can use a mocked modulestore.
# Use this modulestore if you do not care about the underlying implementation.
# TODO: acutally mock out the modulestore for this in a subsequent PR.
TEST_DATA_MOCK_MODULESTORE
=
mixed_store_config
(
mkdtemp
(),
{},
include_xml
=
False
)
class
ModuleStoreTestCase
(
TestCase
):
"""
...
...
@@ -240,7 +235,7 @@ class ModuleStoreTestCase(TestCase):
your `setUp()` method.
"""
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
MODULESTORE
=
mixed_store_config
(
mkdtemp
(),
{},
include_xml
=
False
)
def
setUp
(
self
,
**
kwargs
):
"""
...
...
lms/djangoapps/courseware/tests/test_courses.py
View file @
649e45b4
...
...
@@ -24,9 +24,7 @@ from xmodule.modulestore.django import _get_modulestore_branch_setting, modulest
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.xml_importer
import
import_course_from_xml
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
(
TEST_DATA_MOCK_MODULESTORE
,
TEST_DATA_MIXED_TOY_MODULESTORE
)
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MIXED_TOY_MODULESTORE
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.tests.xml
import
factories
as
xml
from
xmodule.tests.xml
import
XModuleXmlImportTest
...
...
@@ -39,9 +37,7 @@ TEST_DATA_DIR = settings.COMMON_TEST_DATA_ROOT
class
CoursesTest
(
ModuleStoreTestCase
):
"""Test methods related to fetching courses."""
@override_settings
(
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
,
CMS_BASE
=
CMS_BASE_TEST
)
@override_settings
(
CMS_BASE
=
CMS_BASE_TEST
)
def
test_get_cms_course_block_link
(
self
):
"""
Tests that get_cms_course_link_by_id and get_cms_block_link_by_id return the right thing
...
...
@@ -81,9 +77,7 @@ class ModuleStoreBranchSettingTest(ModuleStoreTestCase):
self
.
assertEqual
(
_get_modulestore_branch_setting
(),
'fake_default_branch'
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
,
CMS_BASE
=
CMS_BASE_TEST
)
@override_settings
(
CMS_BASE
=
CMS_BASE_TEST
)
class
MongoCourseImageTestCase
(
ModuleStoreTestCase
):
"""Tests for course image URLs when using a mongo modulestore."""
...
...
lms/djangoapps/django_comment_client/base/tests.py
View file @
649e45b4
...
...
@@ -2,7 +2,6 @@ import logging
import
json
from
django.test.client
import
Client
,
RequestFactory
from
django.test.utils
import
override_settings
from
django.contrib.auth.models
import
User
from
django.core.management
import
call_command
from
django.core.urlresolvers
import
reverse
...
...
@@ -11,7 +10,6 @@ from nose.tools import assert_true, assert_equal # pylint: disable=no-name-in-m
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
lms.lib.comment_client
import
Thread
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MOCK_MODULESTORE
from
django_comment_client.base
import
views
from
django_comment_client.tests.group_id
import
CohortedTopicGroupIdTestMixin
,
NonCohortedTopicGroupIdTestMixin
,
GroupIdAssertionMixin
from
django_comment_client.tests.utils
import
CohortedTestCase
...
...
@@ -993,7 +991,6 @@ class CreateSubCommentUnicodeTestCase(ModuleStoreTestCase, UnicodeTestMixin, Moc
del
Thread
.
commentable_id
@override_settings
(
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
)
class
ForumEventTestCase
(
ModuleStoreTestCase
,
MockRequestSetupMixin
):
"""
Forum actions are expected to launch analytics events. Test these here.
...
...
@@ -1092,7 +1089,6 @@ class ForumEventTestCase(ModuleStoreTestCase, MockRequestSetupMixin):
self
.
assertEqual
(
event
[
'options'
][
'followed'
],
False
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
)
class
UsersEndpointTestCase
(
ModuleStoreTestCase
,
MockRequestSetupMixin
):
def
set_post_counts
(
self
,
mock_request
,
threads_count
=
1
,
comments_count
=
1
):
...
...
lms/djangoapps/instructor/tests/test_api.py
View file @
649e45b4
...
...
@@ -32,7 +32,6 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
from
course_modes.models
import
CourseMode
from
courseware.models
import
StudentModule
from
courseware.tests.factories
import
StaffFactory
,
InstructorFactory
,
BetaTesterFactory
from
xmodule.modulestore.tests.django_utils
import
TEST_DATA_MOCK_MODULESTORE
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
django_comment_common.models
import
FORUM_ROLE_COMMUNITY_TA
from
django_comment_common.utils
import
seed_permissions_roles
...
...
@@ -2320,7 +2319,6 @@ class TestInstructorAPIRegradeTask(ModuleStoreTestCase, LoginEnrollmentTestCase)
self
.
assertEqual
(
response
.
status_code
,
400
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
)
@patch.dict
(
settings
.
FEATURES
,
{
'ENTRANCE_EXAMS'
:
True
})
class
TestEntranceExamInstructorAPIRegradeTask
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
"""
...
...
@@ -2565,7 +2563,6 @@ class TestEntranceExamInstructorAPIRegradeTask(ModuleStoreTestCase, LoginEnrollm
self
.
assertContains
(
response
,
message
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MOCK_MODULESTORE
)
@patch
(
'bulk_email.models.html_to_text'
,
Mock
(
return_value
=
'Mocking CourseEmail.text_message'
))
@patch.dict
(
settings
.
FEATURES
,
{
'ENABLE_INSTRUCTOR_EMAIL'
:
True
,
'REQUIRE_COURSE_EMAIL_AUTH'
:
False
})
class
TestInstructorSendEmail
(
ModuleStoreTestCase
,
LoginEnrollmentTestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment