Replace np links with www to fix 403 forbidden error.

This commit is contained in:
Michael Lazar
2016-02-04 15:33:50 -08:00
parent 20a17ec2b3
commit ff29429601
4 changed files with 2681 additions and 1330 deletions

View File

@@ -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):