File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -736,7 +736,7 @@ def __init__(self, url_pattern):
736736 if type_ == 'string' :
737737 pattern = '[^/]+'
738738 elif type_ == 'int' :
739- pattern = '\\ d+'
739+ pattern = '-? \\ d+'
740740 elif type_ == 'path' :
741741 pattern = '.+'
742742 elif type_ .startswith ('re:' ):
Original file line number Diff line number Diff line change @@ -56,10 +56,12 @@ def test_int_argument(self):
5656
5757 p = URLPattern ('/users/<int:id>/<int:id2>/' )
5858 self .assertEqual (p .match ('/users/123/456/' ), {'id' : 123 , 'id2' : 456 })
59+ self .assertEqual (p .match ('/users/123/-456/' ), {'id' : 123 , 'id2' : - 456 })
5960 self .assertIsNone (p .match ('/users/' ))
60- self .assertIsNone (p .match ('/users/123/456' ))
61+ self .assertIsNone (p .match ('/users/123/- 456' ))
6162 self .assertIsNone (p .match ('/users/123/abc/' ))
62- self .assertIsNone (p .match ('/users/123/456/abc' ))
63+ self .assertIsNone (p .match ('/users/123/-456/abc' ))
64+ self .assertIsNone (p .match ('/users/--123/456/' ))
6365
6466 def test_path_argument (self ):
6567 p = URLPattern ('/users/<path:path>' )
You can’t perform that action at this time.
0 commit comments