Commit 77dc4626 by Gabe Mulley

Minor revision to user activity

Change-Id: Ic49d40eedcc5d5852c5f9f104cdf2796d9500a3d
parent d7c39e6e
...@@ -124,7 +124,7 @@ class CourseActivityMostRecentWeekView(generics.RetrieveAPIView): ...@@ -124,7 +124,7 @@ class CourseActivityMostRecentWeekView(generics.RetrieveAPIView):
Parameters: Parameters:
- course_id (string): Unique identifier for the course. - course_id (string): Unique identifier for the course.
- label (string): The type of activity. Possible values: - label (string): The type of activity. Defaults to `ACTIVE`. Possible values:
- `ACTIVE` - `ACTIVE`
- `PLAYED_VIDEO` - `PLAYED_VIDEO`
- `ATTEMPTED_PROBLEM` - `ATTEMPTED_PROBLEM`
......
from unittest import TestCase
from analyticsdataclient.course import Course
from analyticsdataclient.tests import InMemoryClient
class CourseTest(TestCase):
def setUp(self):
self.client = InMemoryClient()
self.course = Course(self.client, 'edX/DemoX/Demo_Course')
def test_recent_activity(self):
# These tests don't feel terribly useful, since it's not really testing any substantial code... just that mock
# values are returned. The risky part of the interface (the URL and the response data) is not tested at all
# since it is mocked out.
course_id = 'edX/DemoX/Demo_Course'
expected_result = {
'course_id': 'edX/DemoX/Demo_Course',
'interval_start': '2014-05-24T00:00:00Z',
'interval_end': '2014-06-01T00:00:00Z',
'label': 'ACTIVE',
'count': 300,
}
self.client.resources['courses/{0}/recent_activity'.format(course_id)] = expected_result
self.assertEquals(self.course.recent_active_user_count, expected_result)
...@@ -96,7 +96,7 @@ The representation has the following fields: ...@@ -96,7 +96,7 @@ The representation has the following fields:
This string should uniquely identify the course. This string should uniquely identify the course.
+ label = `active` (optional, string) ... The type of activity. + label = `ACTIVE` (optional, string) ... The type of activity.
+ Values + Values
+ `ACTIVE` + `ACTIVE`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment