test: Remove reference to the courseware url.
The courseware URL is going away but it's just used here to test the middleware. That can be test with other urls that are relevant to this middleware. Note, I was unable to re-produce the failures so I've put back using the standard `reverse` logic for fetching the URL in the test.
This commit is contained in:
@@ -5,6 +5,7 @@ from unittest.mock import Mock, patch
|
||||
from django.http import HttpResponse
|
||||
from django.test import TestCase
|
||||
from django.test.client import RequestFactory
|
||||
from django.urls import reverse
|
||||
|
||||
from common.djangoapps.student.tests.factories import AnonymousUserFactory, UserFactory
|
||||
from openedx.core.djangolib.testing.utils import skip_unless_lms
|
||||
@@ -29,9 +30,7 @@ class TagsMiddlewareTest(TestCase):
|
||||
self.course_id = 'mock/course/id'
|
||||
self.request_factory = RequestFactory()
|
||||
|
||||
# TODO: Make it so we can use reverse. Appears to fail depending on the order in which tests are run
|
||||
#self.request = RequestFactory().get(reverse('courseware', kwargs={'course_id': self.course_id}))
|
||||
self.request = RequestFactory().get(f'/courses/{self.course_id}/courseware')
|
||||
self.request = RequestFactory().get(reverse('progress', kwargs={'course_id': self.course_id}))
|
||||
self.request.user = self.user
|
||||
|
||||
self.response = Mock(spec=HttpResponse)
|
||||
|
||||
Reference in New Issue
Block a user