fix: when redirecting to the MFE, preserve query flags

This can potentially fix analytics based on query params like
utm_campaign and the like. And generally seems like the correct
thing to do.

AA-1128
This commit is contained in:
Michael Terry
2021-12-07 13:48:04 -05:00
parent f1cc288189
commit bf2c2ce3c3
7 changed files with 53 additions and 11 deletions

View File

@@ -227,6 +227,15 @@ class TestCourseHomePage(CourseHomePageTestCase): # lint-amnesty, pylint: disab
response = self.client.get(url)
assert response.status_code == 200
def test_legacy_redirect(self):
"""
Verify that the legacy course home page redirects to the MFE correctly.
"""
url = course_home_url(self.course) + '?foo=b$r'
response = self.client.get(url)
assert response.status_code == 302
assert response.get('Location') == 'http://learning-mfe/course/course-v1:edX+test+Test_Course/home?foo=b%24r'
@ddt.ddt
class TestCourseHomePageAccess(CourseHomePageTestCase):