From eabcd1dc39f3c1c31ab57834a692e27780d2c1dc 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 891b44748..24e5f525d 100644 --- a/tests/schemas/test_openapi.py +++ b/tests/schemas/test_openapi.py @@ -215,18 +215,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."""