Commit dd18a8e6 by Jason Bau Committed by Ned Batchelder

User service PR: fix unrelated courseware test

Makes lms/djangoapps/courseware/tests/test_views.py:test_index_invalid_position
actually do what it intends to do, but fixing the URL the
test client visits
parent 314ad957
...@@ -89,8 +89,7 @@ class ViewsTestCase(TestCase): ...@@ -89,8 +89,7 @@ class ViewsTestCase(TestCase):
self.component = ItemFactory.create(category='problem', parent_location=self.vertical.location) self.component = ItemFactory.create(category='problem', parent_location=self.vertical.location)
self.course_key = self.course.id self.course_key = self.course.id
self.user = User.objects.create(username='dummy', password='123456', self.user = UserFactory(username='dummy', password='123456', email='test@mit.edu')
email='test@mit.edu')
self.date = datetime(2013, 1, 22, tzinfo=UTC) self.date = datetime(2013, 1, 22, tzinfo=UTC)
self.enrollment = CourseEnrollment.enroll(self.user, self.course_key) self.enrollment = CourseEnrollment.enroll(self.user, self.course_key)
self.enrollment.created = self.date self.enrollment.created = self.date
...@@ -164,10 +163,12 @@ class ViewsTestCase(TestCase): ...@@ -164,10 +163,12 @@ class ViewsTestCase(TestCase):
request_url = '/'.join([ request_url = '/'.join([
'/courses', '/courses',
self.course.id.to_deprecated_string(), self.course.id.to_deprecated_string(),
'courseware',
self.chapter.location.name, self.chapter.location.name,
self.section.location.name, self.section.location.name,
'f' 'f'
]) ])
self.client.login(username=self.user.username, password="123456")
response = self.client.get(request_url) response = self.client.get(request_url)
self.assertEqual(response.status_code, 404) self.assertEqual(response.status_code, 404)
...@@ -176,11 +177,12 @@ class ViewsTestCase(TestCase): ...@@ -176,11 +177,12 @@ class ViewsTestCase(TestCase):
url_parts = [ url_parts = [
'/courses', '/courses',
self.course.id.to_deprecated_string(), self.course.id.to_deprecated_string(),
'courseware',
self.chapter.location.name, self.chapter.location.name,
self.section.location.name, self.section.location.name,
'1' '1'
] ]
self.client.login(username=self.user.username, password="123456")
for idx, val in enumerate(url_parts): for idx, val in enumerate(url_parts):
url_parts_copy = url_parts[:] url_parts_copy = url_parts[:]
url_parts_copy[idx] = val + u'χ' url_parts_copy[idx] = val + u'χ'
......
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