From 68ab4558ef57e7697c7d666abda2a4b7c5a4aa74 Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Wed, 20 Jul 2022 23:59:42 +0200 Subject: [PATCH 1/2] Use example.com domain for the samples. --- tests/schemas/test_managementcommand.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/schemas/test_managementcommand.py b/tests/schemas/test_managementcommand.py index 645eaf91d7..a05ea93128 100644 --- a/tests/schemas/test_managementcommand.py +++ b/tests/schemas/test_managementcommand.py @@ -52,9 +52,9 @@ def test_command_detects_schema_generation_mode(self): @pytest.mark.skipif(yaml is None, reason='PyYAML is required.') def test_renders_default_schema_with_custom_title_url_and_description(self): call_command('generateschema', - '--title=SampleAPI', - '--url=http://api.sample.com', - '--description=Sample description', + '--title=EampleAPI', + '--url=http://api.example.com', + '--description=Example description', stdout=self.out) # Check valid YAML was output. schema = yaml.safe_load(self.out.getvalue()) @@ -94,8 +94,8 @@ def test_writes_schema_to_file_on_parameter(self): @override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'}) def test_coreapi_renders_default_schema_with_custom_title_url_and_description(self): expected_out = """info: - description: Sample description - title: SampleAPI + description: Example description + title: ExampleAPI version: '' openapi: 3.0.0 paths: @@ -103,12 +103,12 @@ def test_coreapi_renders_default_schema_with_custom_title_url_and_description(se get: operationId: list servers: - - url: http://api.sample.com/ + - url: http://api.example.com/ """ call_command('generateschema', - '--title=SampleAPI', - '--url=http://api.sample.com', - '--description=Sample description', + '--title=ExampleAPI', + '--url=http://api.example.com', + '--description=Example description', stdout=self.out) self.assertIn(formatting.dedent(expected_out), self.out.getvalue()) From f01c4d8ba62c4e218ce1200d0ee122386c128b6c Mon Sep 17 00:00:00 2001 From: Sergey Lyapustin Date: Thu, 21 Jul 2022 00:03:04 +0200 Subject: [PATCH 2/2] Fixed typo. --- tests/schemas/test_managementcommand.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/schemas/test_managementcommand.py b/tests/schemas/test_managementcommand.py index a05ea93128..4104d4ca62 100644 --- a/tests/schemas/test_managementcommand.py +++ b/tests/schemas/test_managementcommand.py @@ -52,7 +52,7 @@ def test_command_detects_schema_generation_mode(self): @pytest.mark.skipif(yaml is None, reason='PyYAML is required.') def test_renders_default_schema_with_custom_title_url_and_description(self): call_command('generateschema', - '--title=EampleAPI', + '--title=ExampleAPI', '--url=http://api.example.com', '--description=Example description', stdout=self.out)