Skip to content

Commit

Permalink
Revert "fix: strip off the spaces in mktg url"
Browse files Browse the repository at this point in the history
This reverts commit b7de0b2.
  • Loading branch information
uzairr committed Sep 14, 2023
1 parent b7de0b2 commit 00b8622
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
4 changes: 2 additions & 2 deletions course_discovery/apps/course_metadata/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3303,8 +3303,8 @@ def weeks_to_complete_max(self):
@property
def marketing_url(self):
if self.marketing_slug:
path = f'{self.type.slug.lower().strip()}/{self.marketing_slug.strip()}'
return urljoin(self.partner.marketing_site_url_root.strip(), path)
path = f'{self.type.slug.lower()}/{self.marketing_slug}'
return urljoin(self.partner.marketing_site_url_root, path)

return None

Expand Down
12 changes: 0 additions & 12 deletions course_discovery/apps/course_metadata/tests/test_models.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2454,18 +2454,6 @@ def test_search(self):
query = 'title:' + self.program.title
self.assertSetEqual({Program.search(query).first()}, {self.program})

def test_spaces_must_be_stripped_off_from_marketing_url(self):
"""
Validate that the spaces in the marketing slug must be stripped off while generating marketing url
"""
# updating the attrs with trailing spaces
self.program.marketing_slug = 'test-slug-0 '
self.program.type.slug = 'test '
site_root = self.program.partner.marketing_site_url_root
self.program.partner.marketing_site_url_root = site_root + ' '

assert self.program.marketing_url.find(' ') == -1

def test_subject_search(self):
"""
Verify that the program endpoint correctly handles elasticsearch queries on the subject uuid
Expand Down

0 comments on commit 00b8622

Please sign in to comment.