Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Inferato committed Oct 23, 2023
1 parent baa1926 commit 5eaf24e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions openedx/core/djangoapps/user_api/accounts/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def test_set_single_social_link(self):
def test_set_multiple_social_links(self):
social_links = [
dict(platform="facebook", social_link=f"https://www.facebook.com/{self.user.username}"),
dict(platform="twitter", social_link=f"https://www.twitter.com/{self.user.username}"),
dict(platform="twitter", social_link=f"https://www.x.com/{self.user.username}"),
]
update_account_settings(self.user, {"social_links": social_links})
account_settings = get_account_settings(self.default_request)[0]
Expand All @@ -197,7 +197,7 @@ def test_add_social_links(self):
update_account_settings(self.user, {"social_links": original_social_links})

extra_social_links = [
dict(platform="twitter", social_link=f"https://www.twitter.com/{self.user.username}"),
dict(platform="twitter", social_link=f"https://www.x.com/{self.user.username}"),
dict(platform="linkedin", social_link=f"https://www.linkedin.com/in/{self.user.username}"),
]
update_account_settings(self.user, {"social_links": extra_social_links})
Expand All @@ -208,7 +208,7 @@ def test_add_social_links(self):

def test_replace_social_links(self):
original_facebook_link = dict(platform="facebook", social_link="https://www.facebook.com/myself")
original_twitter_link = dict(platform="twitter", social_link="https://www.twitter.com/myself")
original_twitter_link = dict(platform="twitter", social_link="https://www.x.com/myself")
update_account_settings(self.user, {"social_links": [original_facebook_link, original_twitter_link]})

modified_facebook_link = dict(platform="facebook", social_link="https://www.facebook.com/new_me")
Expand All @@ -219,7 +219,7 @@ def test_replace_social_links(self):

def test_remove_social_link(self):
original_facebook_link = dict(platform="facebook", social_link="https://www.facebook.com/myself")
original_twitter_link = dict(platform="twitter", social_link="https://www.twitter.com/myself")
original_twitter_link = dict(platform="twitter", social_link="https://www.x.com/myself")
update_account_settings(self.user, {"social_links": [original_facebook_link, original_twitter_link]})

removed_facebook_link = dict(platform="facebook", social_link="")
Expand Down
10 changes: 5 additions & 5 deletions openedx/core/djangoapps/user_api/accounts/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def validate_social_link(self, social_platform, link):
('facebook', 'facebook.com/edX/', 'https://www.facebook.com/edX', True),
('facebook', 'HTTP://facebook.com/edX/', 'https://www.facebook.com/edX', True),
('facebook', 'www.evilwebsite.com/123', None, False),
('twitter', 'https://www.twiter.com/edX/', None, False),
('twitter', 'https://www.twitter.com/edX/123s', None, False),
('twitter', 'twitter.com/edX', 'https://www.twitter.com/edX', True),
('twitter', 'twitter.com/edX?foo=bar', 'https://www.twitter.com/edX', True),
('twitter', 'twitter.com/test.user', 'https://www.twitter.com/test.user', True),
('twitter', 'https://www.x.com/edX/', None, False),
('twitter', 'https://www.x.com/edX/123s', None, False),
('twitter', 'x.com/edX', 'https://www.x.com/edX', True),
('twitter', 'x.com/edX?foo=bar', 'https://www.x.com/edX', True),
('twitter', 'x.com/test.user', 'https://www.x.com/test.user', True),
('linkedin', 'www.linkedin.com/harryrein', None, False),
('linkedin', 'www.linkedin.com/in/harryrein-1234', 'https://www.linkedin.com/in/harryrein-1234', True),
('linkedin', 'www.evilwebsite.com/123?www.linkedin.com/edX', None, False),
Expand Down

0 comments on commit 5eaf24e

Please sign in to comment.