Add last visited module path to course status API

This commit is contained in:
Greg Price
2014-11-26 14:16:19 -05:00
parent b56d074648
commit 3a7e125109
2 changed files with 21 additions and 7 deletions

View File

@@ -186,7 +186,7 @@ class TestUserApi(ModuleStoreTestCase, APITestCase):
self.assertEqual(response.status_code, 401)
def test_default_value(self):
(__, __, unit, __) = self._setup_course_skeleton()
(section, sub_section, unit, __) = self._setup_course_skeleton()
self.client.login(username=self.username, password=self.password)
url = self._course_status_url()
@@ -195,6 +195,10 @@ class TestUserApi(ModuleStoreTestCase, APITestCase):
self.assertEqual(result.status_code, 200)
self.assertEqual(json_data["last_visited_module_id"], unicode(unit.location))
self.assertEqual(
json_data["last_visited_module_path"],
[unicode(module.location) for module in [unit, sub_section, section, self.course]]
)
def test_course_update_no_args(self):
self.client.login(username=self.username, password=self.password)