Skip to content

Commit

Permalink
GH PR parser - Use links in markdown for funders
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Aug 31, 2022
1 parent b9fc0ce commit ba900fe
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit ba900fe

Please sign in to comment.