-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix create_django_urls for build correct regex pattern (#174)
* Fix create_django_urls for build correct regex pattern * Change change log. Increment version * Wrap long strint to parentheses Co-authored-by: Maxim Luzin <Lumax.rus@gmail.com>
- Loading branch information
1 parent
31781e4
commit e444690
Showing
4 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from tests.controllers.controller_with_path_parameters import ControllerWithPathParameters | ||
from winter_django import create_django_urls | ||
|
||
|
||
def test_create_django_urls(): | ||
expected_url_pattern = ( | ||
'^controller_with_path_parameters/(?P<param1>[^/]+)/(?P<param2>\\d+)/' | ||
'(?P<param3>((one)|(two)))/(?P<param4>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/' | ||
'(?P<param5>((1)|(2)))/$' | ||
) | ||
|
||
urls = create_django_urls(ControllerWithPathParameters) | ||
|
||
assert len(urls) == 1 | ||
assert urls[0].pattern.regex.pattern == expected_url_pattern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '4.1.0' | ||
__version__ = '4.1.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters