Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH PR parser - Use links in markdown for funders #1439

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions django_project/changes/tests/test_github_pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,22 @@ def test_funded_by(self):
self.assertEqual('Lyon', funded_by)
self.assertEqual('', url)

def test_funded_by_markdown_url(self):
""" Test parsing the PR content with a markdown URL. """
# With URL written as markdown
body = (
'This is a new feature :\n\n'
'* Funded by [myself](https://my.self.inc)\n'
'* IT\n'
'* WILL\n'
'* ROCK'
)
content, funded_by, url = parse_funded_by(body)
self.assertEqual(
'This is a new feature :\n\n* IT\n* WILL\n* ROCK', content)
self.assertEqual('myself', funded_by)
self.assertEqual('https://my.self.inc', url)

@override_settings(VALID_DOMAIN=['testserver', ])
@mock.patch('requests.get', side_effect=mocked_request_get_github)
def test_create_entry_from_github_pr_timeout(self, mock_request):
Expand Down