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
d6522cd1
Commit
d6522cd1
authored
Feb 24, 2014
by
Adam Palay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor static tab tests
parent
0f0b2622
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
17 deletions
+37
-17
lms/djangoapps/courseware/tests/test_about.py
+12
-8
lms/djangoapps/courseware/tests/test_course_info.py
+12
-4
lms/djangoapps/courseware/tests/test_tabs.py
+13
-5
No files found.
lms/djangoapps/courseware/tests/test_about.py
View file @
d6522cd1
...
@@ -19,10 +19,6 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -19,10 +19,6 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
category
=
"about"
,
parent_location
=
self
.
course
.
location
,
category
=
"about"
,
parent_location
=
self
.
course
.
location
,
data
=
"OOGIE BLOOGIE"
,
display_name
=
"overview"
data
=
"OOGIE BLOOGIE"
,
display_name
=
"overview"
)
)
# The following XML course is closed; we're testing that
# an about page still appears when the course is already closed
self
.
xml_course_id
=
'edX/detached_pages/2014'
self
.
xml_data
=
"about page 463139"
def
test_logged_in
(
self
):
def
test_logged_in
(
self
):
self
.
setup_user
()
self
.
setup_user
()
...
@@ -37,6 +33,18 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -37,6 +33,18 @@ class AboutTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
self
.
assertIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
AboutTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
# The following XML test course (which lives at common/test/data/2014)
# is closed; we're testing that an about page still appears when
# the course is already closed
xml_course_id
=
'edX/detached_pages/2014'
# this text appears in that course's about page
# common/test/data/2014/about/overview.html
xml_data
=
"about page 463139"
@mock.patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@mock.patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
def
test_logged_in_xml
(
self
):
def
test_logged_in_xml
(
self
):
self
.
setup_user
()
self
.
setup_user
()
...
@@ -68,10 +76,6 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, ModuleStoreTes
...
@@ -68,10 +76,6 @@ class AboutWithCappedEnrollmentsTestCase(LoginEnrollmentTestCase, ModuleStoreTes
category
=
"about"
,
parent_location
=
self
.
course
.
location
,
category
=
"about"
,
parent_location
=
self
.
course
.
location
,
data
=
"OOGIE BLOOGIE"
,
display_name
=
"overview"
data
=
"OOGIE BLOOGIE"
,
display_name
=
"overview"
)
)
# The following XML course is closed; we're testing that
# an about page still appears when the course is already closed
self
.
xml_course_id
=
'edX/detached_pages/2014'
self
.
xml_data
=
"about page 463139"
def
test_enrollment_cap
(
self
):
def
test_enrollment_cap
(
self
):
"""
"""
...
...
lms/djangoapps/courseware/tests/test_course_info.py
View file @
d6522cd1
...
@@ -19,10 +19,6 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -19,10 +19,6 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
category
=
"course_info"
,
parent_location
=
self
.
course
.
location
,
category
=
"course_info"
,
parent_location
=
self
.
course
.
location
,
data
=
"OOGIE BLOOGIE"
,
display_name
=
"updates"
data
=
"OOGIE BLOOGIE"
,
display_name
=
"updates"
)
)
# The following XML course is closed; we're testing that
# a course info page still appears when the course is already closed
self
.
xml_data
=
"course info 463139"
self
.
xml_course_id
=
"edX/detached_pages/2014"
def
test_logged_in
(
self
):
def
test_logged_in
(
self
):
self
.
setup_user
()
self
.
setup_user
()
...
@@ -37,6 +33,18 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -37,6 +33,18 @@ class CourseInfoTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertNotIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
self
.
assertNotIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
CourseInfoTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
# The following XML test course (which lives at common/test/data/2014)
# is closed; we're testing that a course info page still appears when
# the course is already closed
xml_course_id
=
'edX/detached_pages/2014'
# this text appears in that course's course info page
# common/test/data/2014/info/updates.html
xml_data
=
"course info 463139"
@mock.patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@mock.patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
def
test_logged_in_xml
(
self
):
def
test_logged_in_xml
(
self
):
self
.
setup_user
()
self
.
setup_user
()
...
...
lms/djangoapps/courseware/tests/test_tabs.py
View file @
d6522cd1
...
@@ -155,11 +155,6 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -155,11 +155,6 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
category
=
"static_tab"
,
parent_location
=
self
.
course
.
location
,
category
=
"static_tab"
,
parent_location
=
self
.
course
.
location
,
data
=
"OOGIE BLOOGIE"
,
display_name
=
"new_tab"
data
=
"OOGIE BLOOGIE"
,
display_name
=
"new_tab"
)
)
# The following XML course is closed; we're testing that
# static tabs still appear when the course is already closed
self
.
xml_data
=
"static 463139"
self
.
xml_url
=
"8e4cce2b4aaf4ba28b1220804619e41f"
self
.
xml_course_id
=
'edX/detached_pages/2014'
def
test_logged_in
(
self
):
def
test_logged_in
(
self
):
self
.
setup_user
()
self
.
setup_user
()
...
@@ -174,6 +169,19 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
...
@@ -174,6 +169,19 @@ class StaticTabDateTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
self
.
assertIn
(
"OOGIE BLOOGIE"
,
resp
.
content
)
@override_settings
(
MODULESTORE
=
TEST_DATA_MIXED_MODULESTORE
)
class
StaticTabDateTestCaseXML
(
LoginEnrollmentTestCase
,
ModuleStoreTestCase
):
# The following XML test course (which lives at common/test/data/2014)
# is closed; we're testing that tabs still appear when
# the course is already closed
xml_course_id
=
'edX/detached_pages/2014'
# this text appears in the test course's tab
# common/test/data/2014/tabs/8e4cce2b4aaf4ba28b1220804619e41f.html
xml_data
=
"static 463139"
xml_url
=
"8e4cce2b4aaf4ba28b1220804619e41f"
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'DISABLE_START_DATES'
:
False
})
def
test_logged_in_xml
(
self
):
def
test_logged_in_xml
(
self
):
self
.
setup_user
()
self
.
setup_user
()
...
...
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