Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
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-analytics-data-api
Commits
5399bf96
Commit
5399bf96
authored
Jul 10, 2014
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for URLs both with and without trailing slashes
Change-Id: I49bff504afb2c27c1e98d021540d7447c080a9c3
parent
99dcad6c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
7 deletions
+4
-7
analytics_data_api/v0/tests.py
+1
-1
analytics_data_api/v0/urls/courses.py
+2
-5
analyticsdataserver/tests.py
+1
-1
No files found.
analytics_data_api/v0/tests.py
View file @
5399bf96
...
...
@@ -50,7 +50,7 @@ class CourseActivityLastWeekTest(TestCaseWithAuthentication):
return
default
def
test_activity_auth
(
self
):
response
=
self
.
client
.
get
(
'/api/v0/courses/{0}/recent_activity'
.
format
(
self
.
course_id
))
response
=
self
.
client
.
get
(
'/api/v0/courses/{0}/recent_activity'
.
format
(
self
.
course_id
)
,
follow
=
True
)
self
.
assertEquals
(
response
.
status_code
,
401
)
def
test_url_encoded_course_id
(
self
):
...
...
analytics_data_api/v0/urls/courses.py
View file @
5399bf96
...
...
@@ -13,10 +13,7 @@ COURSE_URLS = [
(
'enrollment/gender'
,
CourseEnrollmentByGenderView
,
'enrollment_by_gender'
),
]
urlpatterns
=
patterns
(
''
,
# url(r'^$', CourseDetailView.as_view(), name='detail')
)
urlpatterns
=
[]
for
path
,
view
,
name
in
COURSE_URLS
:
urlpatterns
+=
patterns
(
''
,
url
(
r'^(?P<course_id>.+)/'
+
re
.
escape
(
path
)
+
r'$'
,
view
.
as_view
(),
name
=
name
))
urlpatterns
+=
patterns
(
''
,
url
(
r'^(?P<course_id>.+)/'
+
re
.
escape
(
path
)
+
r'
/
$'
,
view
.
as_view
(),
name
=
name
))
analyticsdataserver/tests.py
View file @
5399bf96
...
...
@@ -16,7 +16,7 @@ class TestCaseWithAuthentication(TestCase):
super
(
TestCaseWithAuthentication
,
self
)
.
setUp
()
test_user
=
User
.
objects
.
create_user
(
'tester'
,
'test@example.com'
,
'testpassword'
)
token
=
Token
.
objects
.
create
(
user
=
test_user
)
self
.
authenticated_get
=
partial
(
self
.
client
.
get
,
HTTP_AUTHORIZATION
=
'Token '
+
token
.
key
)
self
.
authenticated_get
=
partial
(
self
.
client
.
get
,
HTTP_AUTHORIZATION
=
'Token '
+
token
.
key
,
follow
=
True
)
@contextmanager
...
...
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