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
66f52ba6
Commit
66f52ba6
authored
Apr 19, 2016
by
Ayub-khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-fixed Tests.
parent
9e3f68c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
cms/djangoapps/contentstore/views/tests/test_tabs.py
+6
-2
cms/djangoapps/contentstore/views/tests/test_user.py
+6
-5
No files found.
cms/djangoapps/contentstore/views/tests/test_tabs.py
View file @
66f52ba6
...
@@ -7,10 +7,12 @@ from contentstore.tests.utils import CourseTestCase
...
@@ -7,10 +7,12 @@ from contentstore.tests.utils import CourseTestCase
from
contentstore.utils
import
reverse_course_url
from
contentstore.utils
import
reverse_course_url
from
xmodule.x_module
import
STUDENT_VIEW
from
xmodule.x_module
import
STUDENT_VIEW
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
django.test.client
import
RequestFactory
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.tabs
import
CourseTabList
from
xmodule.tabs
import
CourseTabList
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
django.http
import
Http404
from
django.http
import
Http404
from
contentstore.views.tabs
import
tabs_handler
class
TabsPageTests
(
CourseTestCase
):
class
TabsPageTests
(
CourseTestCase
):
...
@@ -194,9 +196,11 @@ class TabsPageTests(CourseTestCase):
...
@@ -194,9 +196,11 @@ class TabsPageTests(CourseTestCase):
def
test_invalid_course_id
(
self
):
def
test_invalid_course_id
(
self
):
""" Asserts that Http404 is raised when the course id is not valid. """
""" Asserts that Http404 is raised when the course id is not valid. """
invalid_tab_url
=
reverse_course_url
(
'tabs_handler'
,
"/some.invalid.key/course-v1:TTT+CS01+2015_T0"
)
request_factory
=
RequestFactory
()
request
=
request_factory
.
get
(
'/dummy-url'
)
request
.
user
=
self
.
user
with
self
.
assertRaises
(
Http404
):
with
self
.
assertRaises
(
Http404
):
self
.
client
.
get
(
invalid_tab_url
)
tabs_handler
(
request
,
"/some.invalid.key/course-v1:TTT+CS01+2015_T0"
)
class
PrimitiveTabEdit
(
ModuleStoreTestCase
):
class
PrimitiveTabEdit
(
ModuleStoreTestCase
):
...
...
cms/djangoapps/contentstore/views/tests/test_user.py
View file @
66f52ba6
...
@@ -10,6 +10,8 @@ from student.models import CourseEnrollment
...
@@ -10,6 +10,8 @@ from student.models import CourseEnrollment
from
student.roles
import
CourseStaffRole
,
CourseInstructorRole
from
student.roles
import
CourseStaffRole
,
CourseInstructorRole
from
student
import
auth
from
student
import
auth
from
django.http
import
Http404
from
django.http
import
Http404
from
contentstore.views.user
import
course_team_handler
from
django.test.client
import
RequestFactory
class
UsersTestCase
(
CourseTestCase
):
class
UsersTestCase
(
CourseTestCase
):
...
@@ -319,9 +321,8 @@ class UsersTestCase(CourseTestCase):
...
@@ -319,9 +321,8 @@ class UsersTestCase(CourseTestCase):
def
test_invalid_course_id
(
self
):
def
test_invalid_course_id
(
self
):
""" Asserts that Http404 is raised when the course id is not valid. """
""" Asserts that Http404 is raised when the course id is not valid. """
wrong_url
=
reverse_course_url
(
request_factory
=
RequestFactory
()
'course_team_handler'
,
"/some.invalid.key/course-v1:TTT+CS01+2015_T0"
,
request
=
request_factory
.
get
(
'/dummy-url'
)
kwargs
=
{
'email'
:
self
.
ext_user
.
email
}
request
.
user
=
self
.
user
)
with
self
.
assertRaises
(
Http404
):
with
self
.
assertRaises
(
Http404
):
self
.
client
.
get
(
wrong_url
)
course_team_handler
(
request
,
"/some.invalid.key/course-v1:TTT+CS01+2015_T0"
)
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