Replace np links with www to fix 403 forbidden error.
This commit is contained in:
@@ -143,7 +143,7 @@ def test_content_submission_load_more_comments(reddit, terminal):
|
||||
assert content.get(390)['type'] == 'Comment'
|
||||
|
||||
|
||||
def test_content_submission_from_url(reddit, terminal):
|
||||
def test_content_submission_from_url(reddit, oauth, refresh_token, terminal):
|
||||
|
||||
url = 'https://www.reddit.com/r/AskReddit/comments/2np694/'
|
||||
SubmissionContent.from_url(reddit, url, terminal.loader)
|
||||
@@ -159,6 +159,14 @@ def test_content_submission_from_url(reddit, terminal):
|
||||
SubmissionContent.from_url(reddit, url[:-2], terminal.loader)
|
||||
assert isinstance(terminal.loader.exception, praw.errors.NotFound)
|
||||
|
||||
# np.* urls should not raise a 403 error when logged into oauth
|
||||
oauth.config.refresh_token = refresh_token
|
||||
oauth.authorize()
|
||||
url = 'https://np.reddit.com//r/LifeProTips/comments/441hsf//czmp112.json'
|
||||
with terminal.loader():
|
||||
SubmissionContent.from_url(reddit, url, terminal.loader)
|
||||
assert not terminal.loader.exception
|
||||
|
||||
|
||||
def test_content_subreddit_initialize(reddit, terminal):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user