mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
failing test for #6888
This commit is contained in:
parent
ec1b14174f
commit
7ee7c453a0
11
tests/schemas/test_get_path_from_regex.py
Normal file
11
tests/schemas/test_get_path_from_regex.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from rest_framework.schemas.generators import EndpointEnumerator
|
||||
|
||||
def test_get_path_from_regex():
|
||||
"""
|
||||
Test that path from regex is correctly formatted.
|
||||
"""
|
||||
path_regex = r'^entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)'
|
||||
expected_path = '/entries/{pk}/relationships/{related_field}'
|
||||
enumerator = EndpointEnumerator(patterns={})
|
||||
path = enumerator.get_path_from_regex(path_regex)
|
||||
assert path == expected_path
|
Loading…
Reference in New Issue
Block a user