Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-val
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-val
Commits
15a69c59
Commit
15a69c59
authored
Sep 15, 2014
by
Dave St.Germain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the correct course_id regex.
parent
73456f89
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
edxval/settings.py
+4
-0
edxval/tests/test_views.py
+3
-3
edxval/urls.py
+2
-1
No files found.
edxval/settings.py
View file @
15a69c59
...
...
@@ -169,3 +169,7 @@ LOGGING = {
},
}
}
# copied from edx-platform
COURSE_KEY_PATTERN
=
r'(?P<course_key_string>[^/+]+(/|\+)[^/+]+(/|\+)[^/]+)'
COURSE_ID_PATTERN
=
COURSE_KEY_PATTERN
.
replace
(
'course_key_string'
,
'course_id'
)
edxval/tests/test_views.py
View file @
15a69c59
...
...
@@ -460,8 +460,8 @@ class VideoListTest(APIAuthTestCase):
"""
url
=
reverse
(
'video-list'
)
video
=
dict
(
**
constants
.
VIDEO_DICT_ANIMAL
)
course1
=
'animals/fish'
course2
=
'animals/birds'
course1
=
'animals/fish
/carp
'
course2
=
'animals/birds
/cardinal
'
video
[
'courses'
]
=
[
course1
,
course2
]
response
=
self
.
client
.
post
(
...
...
@@ -477,7 +477,7 @@ class VideoListTest(APIAuthTestCase):
self
.
assertEqual
(
len
(
videos
),
1
)
self
.
assertEqual
(
videos
[
0
][
'edx_video_id'
],
constants
.
VIDEO_DICT_ANIMAL
[
'edx_video_id'
])
url
=
reverse
(
'course-video-list'
,
kwargs
=
{
'course_id'
:
course1
+
'/bad
'
})
url
=
reverse
(
'course-video-list'
,
kwargs
=
{
'course_id'
:
'animals/fish/salmon
'
})
response
=
self
.
client
.
get
(
url
)
.
data
self
.
assertEqual
(
len
(
response
),
0
)
...
...
edxval/urls.py
View file @
15a69c59
...
...
@@ -3,6 +3,7 @@ Url file for django app edxval.
"""
from
django.conf.urls
import
patterns
,
url
from
django.conf
import
settings
from
edxval
import
views
...
...
@@ -29,7 +30,7 @@ urlpatterns = patterns(
name
=
"subtitle-content"
),
url
(
r'^edxval/course/
(?P<course_id>[-\w/]+)$'
,
r'^edxval/course/
{}$'
.
format
(
settings
.
COURSE_ID_PATTERN
)
,
views
.
CourseVideoList
.
as_view
(),
name
=
"course-video-list"
),
...
...
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