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
ef70d017
Commit
ef70d017
authored
Apr 15, 2016
by
Ayub-khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-fixed failing tests
-Adressed all comments
parent
d8464dbf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
19 deletions
+26
-19
cms/djangoapps/contentstore/views/course.py
+2
-2
cms/djangoapps/contentstore/views/tests/test_tabs.py
+0
-1
common/djangoapps/util/course_key_utils.py
+1
-2
common/djangoapps/util/tests/test_course_key_utils.py
+20
-12
lms/djangoapps/django_comment_client/forum/tests.py
+3
-2
No files found.
cms/djangoapps/contentstore/views/course.py
View file @
ef70d017
...
...
@@ -91,7 +91,7 @@ from util.organizations_helpers import (
organizations_enabled
,
)
from
util.string_utils
import
_has_non_ascii_characters
from
util.course_key_utils
import
from_string_or_404
from
util.course_key_utils
import
course_key_
from_string_or_404
from
xmodule.contentstore.content
import
StaticContent
from
xmodule.course_module
import
CourseFields
from
xmodule.course_module
import
DEFAULT_START_DATE
...
...
@@ -875,7 +875,7 @@ def course_info_handler(request, course_key_string):
GET
html: return html for editing the course info handouts and updates.
"""
course_key
=
from_string_or_404
(
course_key_string
)
course_key
=
course_key_
from_string_or_404
(
course_key_string
)
with
modulestore
()
.
bulk_operations
(
course_key
):
course_module
=
get_course_and_check_access
(
course_key
,
request
.
user
)
...
...
cms/djangoapps/contentstore/views/tests/test_tabs.py
View file @
ef70d017
...
...
@@ -199,7 +199,6 @@ class TabsPageTests(CourseTestCase):
self
.
client
.
get
(
invalid_tab_url
)
class
PrimitiveTabEdit
(
ModuleStoreTestCase
):
"""Tests for the primitive tab edit data manipulations"""
...
...
common/djangoapps/util/course_key_utils.py
View file @
ef70d017
...
...
@@ -28,4 +28,4 @@ def course_key_from_string_or_404(course_key_string, message=None):
except
InvalidKeyError
:
raise
Http404
(
message
)
return
course_key
\ No newline at end of file
return
course_key
common/djangoapps/util/tests/test_course_key_utils.py
View file @
ef70d017
...
...
@@ -14,22 +14,32 @@ class TestFromStringOr404(unittest.TestCase):
Base Test class for course_key_from_string_or_404 utility tests
"""
@ddt.data
(
(
"/some.invalid.key/course-v1:TTT+CS01+2015_T0"
,
"course-v1:TTT+CS01+2015_T0"
)
,
# split style course keys
(
"/some.invalid.key/TTT/CS01/2015_T0"
,
"TTT/CS01/2015_T0"
),
# mongo style course keys
"course-v1:TTT+CS01+2015_T0"
,
# split style course keys
"TTT/CS01/2015_T0"
# mongo style course keys
)
def
test_from_string_or_404
(
self
,
(
invalid_course_key
,
valid_course_key
)
):
def
test_from_string_or_404
_for_valid_course_key
(
self
,
valid_course_key
):
"""
Tests course_key_from_string_or_404 for valid and invalid split style course keys and mongo style course keys.
Tests course_key_from_string_or_404 for valid split style course keys and mongo style course keys.
"""
from
nose.tools
import
set_trace
;
set_trace
()
self
.
assertEquals
(
CourseKey
.
from_string
(
valid_course_key
),
course_key_from_string_or_404
(
valid_course_key
)
)
@ddt.data
(
"/some.invalid.key/course-v1:TTT+CS01+2015_T0"
,
# split style course keys
"/some.invalid.key/TTT/CS01/2015_T0"
# mongo style course keys
)
def
test_from_string_or_404_for_invalid_course_key
(
self
,
invalid_course_key
):
"""
Tests course_key_from_string_or_404 for valid split style course keys and mongo style course keys.
"""
self
.
assertRaises
(
Http404
,
course_key_from_string_or_404
,
invalid_course_key
,
)
self
.
assertEquals
(
CourseKey
.
from_string
(
valid_course_key
),
course_key_from_string_or_404
(
valid_course_key
)
)
@ddt.data
(
"/some.invalid.key/course-v1:TTT+CS01+2015_T0"
,
# split style invalid course key
...
...
@@ -40,7 +50,6 @@ class TestFromStringOr404(unittest.TestCase):
Tests course_key_from_string_or_404 with exception message for split style and monog style invalid course keys.
:return:
"""
try
:
with
self
.
assertRaises
(
Http404
)
as
context
:
course_key_from_string_or_404
(
course_string
,
message
=
"Invalid Keys"
)
except
Http404
as
exception
:
self
.
assertEquals
(
str
(
exception
),
"Invalid Keys"
)
\ No newline at end of file
self
.
assertEquals
(
str
(
context
.
exception
),
"Invalid Keys"
)
lms/djangoapps/django_comment_client/forum/tests.py
View file @
ef70d017
...
...
@@ -1318,8 +1318,9 @@ class InlineDiscussionUnicodeTestCase(SharedModuleStoreTestCase, UnicodeTestMixi
request
.
user
=
self
.
student
with
self
.
assertRaises
(
Http404
):
views
.
inline_discussion
(
request
,
self
.
course
.
id
.
to_deprecated_string
(),
self
.
course
.
discussion_topics
[
'General'
][
'id'
]
)
request
,
unicode
(
self
.
course
.
id
),
self
.
course
.
discussion_topics
[
'General'
][
'id'
]
)
class
ForumFormDiscussionUnicodeTestCase
(
SharedModuleStoreTestCase
,
UnicodeTestMixin
):
@classmethod
...
...
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