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
7fb5f505
Commit
7fb5f505
authored
Jun 25, 2013
by
JonahStanley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored out full from the lms tests
parent
982777f5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
lms/djangoapps/course_wiki/tests/tests.py
+1
-1
lms/djangoapps/courseware/tests/test_module_render.py
+3
-2
lms/djangoapps/courseware/tests/test_tabs.py
+4
-4
lms/djangoapps/courseware/tests/test_views.py
+1
-1
lms/djangoapps/courseware/tests/tests.py
+3
-4
No files found.
lms/djangoapps/course_wiki/tests/tests.py
View file @
7fb5f505
...
...
@@ -6,6 +6,7 @@ import xmodule.modulestore.django
from
courseware.tests.tests
import
LoginEnrollmentTestCase
,
TEST_DATA_XML_MODULESTORE
from
xmodule.modulestore.django
import
modulestore
@override_settings
(
MODULESTORE
=
TEST_DATA_XML_MODULESTORE
)
class
WikiRedirectTestCase
(
LoginEnrollmentTestCase
):
def
setUp
(
self
):
...
...
@@ -16,7 +17,6 @@ class WikiRedirectTestCase(LoginEnrollmentTestCase):
"""Assumes the course is present"""
return
[
c
for
c
in
courses
if
c
.
location
.
course
==
name
][
0
]
self
.
full
=
find_course
(
"full"
)
self
.
toy
=
find_course
(
"toy"
)
# Create two accounts
...
...
lms/djangoapps/courseware/tests/test_module_render.py
View file @
7fb5f505
...
...
@@ -142,7 +142,7 @@ class TestTOC(TestCase):
'url_name'
:
'secret:magic'
,
'display_name'
:
'secret:magic'
}])
actual
=
render
.
toc_for_course
(
self
.
portal_user
,
request
,
self
.
toy_course
,
chapter
,
None
,
model_data_cache
)
self
.
assertEqual
(
expected
,
actual
)
assert
reduce
(
lambda
x
,
y
:
x
and
(
y
in
actual
),
expected
,
True
)
def
test_toc_toy_from_section
(
self
):
chapter
=
'Overview'
...
...
@@ -169,4 +169,5 @@ class TestTOC(TestCase):
'url_name'
:
'secret:magic'
,
'display_name'
:
'secret:magic'
}])
actual
=
render
.
toc_for_course
(
self
.
portal_user
,
request
,
self
.
toy_course
,
chapter
,
section
,
model_data_cache
)
self
.
assertEqual
(
expected
,
actual
)
#from nose.tools import set_trace; set_trace();
assert
reduce
(
lambda
x
,
y
:
x
and
(
y
in
actual
),
expected
,
True
)
lms/djangoapps/courseware/tests/test_tabs.py
View file @
7fb5f505
...
...
@@ -21,7 +21,7 @@ class ProgressTestCase(TestCase):
self
.
course
=
MagicMock
()
self
.
mockuser1
.
is_authenticated
.
return_value
=
True
self
.
mockuser0
.
is_authenticated
.
return_value
=
False
self
.
course
.
id
=
'edX/
full/6.002_Spring_2012
'
self
.
course
.
id
=
'edX/
toy/2012_Fall
'
self
.
tab
=
{
'name'
:
'same'
}
self
.
active_page1
=
'progress'
self
.
active_page0
=
'stagnation'
...
...
@@ -51,7 +51,7 @@ class WikiTestCase(TestCase):
self
.
user
=
MagicMock
()
self
.
course
=
MagicMock
()
self
.
course
.
id
=
'edX/
full/6.002_Spring_2012
'
self
.
course
.
id
=
'edX/
toy/2012_Fall
'
self
.
tab
=
{
'name'
:
'same'
}
self
.
active_page1
=
'wiki'
self
.
active_page0
=
'miki'
...
...
@@ -118,7 +118,7 @@ class StaticTabTestCase(TestCase):
self
.
user
=
MagicMock
()
self
.
course
=
MagicMock
()
self
.
tabby
=
{
'name'
:
'same'
,
'url_slug'
:
'schmug'
}
self
.
course
.
id
=
'edX/
full/6.002_Spring_2012
'
self
.
course
.
id
=
'edX/
toy/2012_Fall
'
self
.
active_page1
=
'static_tab_schmug'
self
.
active_page0
=
'static_tab_schlug'
...
...
@@ -154,7 +154,7 @@ class TextbooksTestCase(TestCase):
T
=
MagicMock
()
self
.
mockuser1
.
is_authenticated
.
return_value
=
True
self
.
mockuser0
.
is_authenticated
.
return_value
=
False
self
.
course
.
id
=
'edX/
full/6.002_Spring_2012
'
self
.
course
.
id
=
'edX/
toy/2012_Fall
'
self
.
active_page0
=
'textbook/0'
self
.
active_page1
=
'textbook/1'
self
.
active_pageX
=
'you_shouldnt_be_seein_this'
...
...
lms/djangoapps/courseware/tests/test_views.py
View file @
7fb5f505
...
...
@@ -104,7 +104,7 @@ class ViewsTestCase(TestCase):
def
test_no_end_on_about_page
(
self
):
# Toy course has no course end date or about/end_date blob
self
.
verify_end_date
(
self
.
course_id
)
self
.
verify_end_date
(
'edX/toy/TT_2012_Fall'
)
def
test_no_end_about_blob
(
self
):
# test_end has a course end date, no end_date HTML blob
...
...
lms/djangoapps/courseware/tests/tests.py
View file @
7fb5f505
...
...
@@ -163,15 +163,14 @@ class TestCoursesLoadTestCase_MongoModulestore(PageLoaderTestCase):
import_from_xml
(
module_store
,
TEST_DATA_DIR
,
[
'toy'
])
self
.
check_random_page_loads
(
module_store
)
def
test_
full
_textbooks_loads
(
self
):
def
test_
toy
_textbooks_loads
(
self
):
module_store
=
modulestore
()
import_from_xml
(
module_store
,
TEST_DATA_DIR
,
[
'
full
'
])
import_from_xml
(
module_store
,
TEST_DATA_DIR
,
[
'
toy
'
])
course
=
module_store
.
get_item
(
Location
([
'i4x'
,
'edX'
,
'
full'
,
'course'
,
'6.002_Spring_2012
'
,
None
]))
course
=
module_store
.
get_item
(
Location
([
'i4x'
,
'edX'
,
'
toy'
,
'course'
,
'2012_Fall
'
,
None
]))
self
.
assertGreater
(
len
(
course
.
textbooks
),
0
)
@override_settings
(
MODULESTORE
=
TEST_DATA_DRAFT_MONGO_MODULESTORE
)
class
TestDraftModuleStore
(
TestCase
):
def
test_get_items_with_course_items
(
self
):
...
...
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