From 178a2dc786461fdd03da0496dccdce7fb4676072 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Sat, 20 Jul 2019 20:58:20 +0200 Subject: [PATCH] Correct OpenAPI test for common prefixes. --- tests/schemas/test_openapi.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/schemas/test_openapi.py b/tests/schemas/test_openapi.py index a928b6b30..674ee9829 100644 --- a/tests/schemas/test_openapi.py +++ b/tests/schemas/test_openapi.py @@ -229,18 +229,18 @@ class TestGenerator(TestCase): assert 'post' in example_operations def test_prefixed_paths_construction(self): - """Construction of the `paths` key with a common prefix.""" + """Construction of the `paths` key maintains a common prefix.""" patterns = [ - url(r'^api/v1/example/?$', views.ExampleListView.as_view()), - url(r'^api/v1/example/{pk}/?$', views.ExampleDetailView.as_view()), + url(r'^v1/example/?$', views.ExampleListView.as_view()), + url(r'^v1/example/{pk}/?$', views.ExampleDetailView.as_view()), ] generator = SchemaGenerator(patterns=patterns) generator._initialise_endpoints() paths = generator.get_paths() - assert '/example/' in paths - assert '/example/{id}/' in paths + assert '/v1/example/' in paths + assert '/v1/example/{id}/' in paths def test_schema_construction(self): """Construction of the top level dictionary."""