mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 04:54:00 +03:00
Use example.com domain in tests. (#8571)
* Use example.com domain for the samples. * Fixed typo.
This commit is contained in:
parent
ad282da97c
commit
a1b35bb44b
|
@ -52,9 +52,9 @@ class GenerateSchemaTests(TestCase):
|
||||||
@pytest.mark.skipif(yaml is None, reason='PyYAML is required.')
|
@pytest.mark.skipif(yaml is None, reason='PyYAML is required.')
|
||||||
def test_renders_default_schema_with_custom_title_url_and_description(self):
|
def test_renders_default_schema_with_custom_title_url_and_description(self):
|
||||||
call_command('generateschema',
|
call_command('generateschema',
|
||||||
'--title=SampleAPI',
|
'--title=ExampleAPI',
|
||||||
'--url=http://api.sample.com',
|
'--url=http://api.example.com',
|
||||||
'--description=Sample description',
|
'--description=Example description',
|
||||||
stdout=self.out)
|
stdout=self.out)
|
||||||
# Check valid YAML was output.
|
# Check valid YAML was output.
|
||||||
schema = yaml.safe_load(self.out.getvalue())
|
schema = yaml.safe_load(self.out.getvalue())
|
||||||
|
@ -94,8 +94,8 @@ class GenerateSchemaTests(TestCase):
|
||||||
@override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'})
|
@override_settings(REST_FRAMEWORK={'DEFAULT_SCHEMA_CLASS': 'rest_framework.schemas.AutoSchema'})
|
||||||
def test_coreapi_renders_default_schema_with_custom_title_url_and_description(self):
|
def test_coreapi_renders_default_schema_with_custom_title_url_and_description(self):
|
||||||
expected_out = """info:
|
expected_out = """info:
|
||||||
description: Sample description
|
description: Example description
|
||||||
title: SampleAPI
|
title: ExampleAPI
|
||||||
version: ''
|
version: ''
|
||||||
openapi: 3.0.0
|
openapi: 3.0.0
|
||||||
paths:
|
paths:
|
||||||
|
@ -103,12 +103,12 @@ class GenerateSchemaTests(TestCase):
|
||||||
get:
|
get:
|
||||||
operationId: list
|
operationId: list
|
||||||
servers:
|
servers:
|
||||||
- url: http://api.sample.com/
|
- url: http://api.example.com/
|
||||||
"""
|
"""
|
||||||
call_command('generateschema',
|
call_command('generateschema',
|
||||||
'--title=SampleAPI',
|
'--title=ExampleAPI',
|
||||||
'--url=http://api.sample.com',
|
'--url=http://api.example.com',
|
||||||
'--description=Sample description',
|
'--description=Example description',
|
||||||
stdout=self.out)
|
stdout=self.out)
|
||||||
|
|
||||||
self.assertIn(formatting.dedent(expected_out), self.out.getvalue())
|
self.assertIn(formatting.dedent(expected_out), self.out.getvalue())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user