File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -361,3 +361,29 @@ def test_empty_url_returns_empty(self):
361361 release_notes_url = "" ,
362362 )
363363 self .assertEqual (release .corrected_release_notes_url , "" )
364+
365+ def test_raw_file_hg_url_converted_to_github_raw (self ):
366+ """A raw-file hg.python.org URL is remapped to raw.githubusercontent.com."""
367+ release = Release .objects .create (
368+ version = Release .PYTHON2 ,
369+ name = "Python 2.7.3" ,
370+ is_published = True ,
371+ release_notes_url = "http://hg.python.org/cpython/raw-file/v2.7.3/Misc/NEWS" ,
372+ )
373+ self .assertEqual (
374+ release .corrected_release_notes_url ,
375+ "https://raw.githubusercontent.com/python/cpython/v2.7.3/Misc/NEWS" ,
376+ )
377+
378+ def test_https_raw_file_hg_url_also_converted (self ):
379+ """An https raw-file hg.python.org URL is also remapped to raw.githubusercontent.com."""
380+ release = Release .objects .create (
381+ version = Release .PYTHON2 ,
382+ name = "Python 2.6.9" ,
383+ is_published = True ,
384+ release_notes_url = "https://hg.python.org/cpython/raw-file/v2.6.9/Misc/NEWS" ,
385+ )
386+ self .assertEqual (
387+ release .corrected_release_notes_url ,
388+ "https://raw.githubusercontent.com/python/cpython/v2.6.9/Misc/NEWS" ,
389+ )
You can’t perform that action at this time.
0 commit comments