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
a16c951c
Commit
a16c951c
authored
Aug 27, 2015
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix imports and test skips to work properly from openedx
parent
f925a4af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
openedx/tests/xblock_integration/test_recommender.py
+13
-4
No files found.
openedx/tests/xblock_integration/test_recommender.py
View file @
a16c951c
...
@@ -2,21 +2,24 @@
...
@@ -2,21 +2,24 @@
This test file will run through some XBlock test scenarios regarding the
This test file will run through some XBlock test scenarios regarding the
recommender system
recommender system
"""
"""
from
copy
import
deepcopy
import
json
import
json
import
itertools
import
itertools
import
StringIO
import
StringIO
import
unittest
from
ddt
import
ddt
,
data
from
ddt
import
ddt
,
data
from
copy
import
deepcopy
from
nose.plugins.attrib
import
attr
from
nose.plugins.attrib
import
attr
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
from
courseware.tests.helpers
import
LoginEnrollmentTestCase
from
lms.djangoapps.courseware.tests.helpers
import
LoginEnrollmentTestCase
from
courseware.tests.factories
import
GlobalStaffFactory
from
lms.djangoapps.courseware.tests.factories
import
GlobalStaffFactory
from
lms.djangoapps.lms_xblock.runtime
import
quote_slashes
from
lms.djangoapps.lms_xblock.runtime
import
quote_slashes
...
@@ -32,6 +35,12 @@ class TestRecommender(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
...
@@ -32,6 +35,12 @@ class TestRecommender(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
@classmethod
@classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
# Nose runs setUpClass methods even if a class decorator says to skip
# the class: https://github.com/nose-devs/nose/issues/946
# So, skip the test class here if we are not in the LMS.
if
settings
.
ROOT_URLCONF
!=
'lms.urls'
:
raise
unittest
.
SkipTest
(
'Test only valid in lms'
)
super
(
TestRecommender
,
cls
)
.
setUpClass
()
super
(
TestRecommender
,
cls
)
.
setUpClass
()
cls
.
course
=
CourseFactory
.
create
(
cls
.
course
=
CourseFactory
.
create
(
display_name
=
'Recommender_Test_Course'
display_name
=
'Recommender_Test_Course'
...
...
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