From f4e1eafb8454a7e0d156f231417dd1a1d6938116 Mon Sep 17 00:00:00 2001 From: Pravin Kamble Date: Tue, 21 Oct 2025 14:02:22 +0530 Subject: [PATCH] Standardize spelling to American English --- docs/api-guide/fields.md | 2 +- docs/api-guide/responses.md | 2 +- docs/api-guide/serializers.md | 4 ++-- docs/api-guide/validators.md | 2 +- docs/community/3.0-announcement.md | 2 +- docs/community/3.12-announcement.md | 2 +- docs/community/3.13-announcement.md | 2 +- docs/community/3.15-announcement.md | 4 ++-- docs/community/3.16-announcement.md | 4 ++-- docs/community/3.5-announcement.md | 8 ++++---- docs/community/3.7-announcement.md | 2 +- docs/community/3.8-announcement.md | 4 ++-- docs/community/release-notes.md | 14 +++++++------- docs/topics/browsable-api.md | 2 +- rest_framework/filters.py | 2 +- rest_framework/generics.py | 2 +- rest_framework/mixins.py | 2 +- rest_framework/schemas/coreapi.py | 6 +++--- rest_framework/schemas/generators.py | 2 +- rest_framework/schemas/openapi.py | 2 +- tests/browsable_api/test_browsable_api.py | 4 ++-- tests/browsable_api/test_browsable_nested_api.py | 2 +- tests/schemas/test_openapi.py | 6 +++--- tests/test_fields.py | 2 +- tests/test_request.py | 8 ++++---- tests/test_serializer_lists.py | 6 +++--- 26 files changed, 49 insertions(+), 49 deletions(-) diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index 8278e2a2f..97e2070ab 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -180,7 +180,7 @@ The `allow_null` option is also available for string fields, although its usage ## EmailField -A text representation, validates the text to be a valid e-mail address. +A text representation, validates the text to be a valid email address. Corresponds to `django.db.models.fields.EmailField` diff --git a/docs/api-guide/responses.md b/docs/api-guide/responses.md index dbdc8ff2c..00fe95196 100644 --- a/docs/api-guide/responses.md +++ b/docs/api-guide/responses.md @@ -11,7 +11,7 @@ source: REST framework supports HTTP content negotiation by providing a `Response` class which allows you to return content that can be rendered into multiple content types, depending on the client request. -The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialised with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content. +The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialized with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content. There's no requirement for you to use the `Response` class, you can also return regular `HttpResponse` or `StreamingHttpResponse` objects from your views if required. Using the `Response` class simply provides a nicer interface for returning content-negotiated Web API responses, that can be rendered to multiple formats. diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index 3ce8f887f..2ff5bcef3 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -155,7 +155,7 @@ When deserializing data, you always need to call `is_valid()` before attempting serializer.is_valid() # False serializer.errors - # {'email': ['Enter a valid e-mail address.'], 'created': ['This field is required.']} + # {'email': ['Enter a valid email address.'], 'created': ['This field is required.']} Each key in the dictionary will be the field name, and the values will be lists of strings of any error messages corresponding to that field. The `non_field_errors` key may also be present, and will list any general validation errors. The name of the `non_field_errors` key may be customized using the `NON_FIELD_ERRORS_KEY` REST framework setting. @@ -298,7 +298,7 @@ When dealing with nested representations that support deserializing the data, an serializer.is_valid() # False serializer.errors - # {'user': {'email': ['Enter a valid e-mail address.']}, 'created': ['This field is required.']} + # {'user': {'email': ['Enter a valid email address.']}, 'created': ['This field is required.']} Similarly, the `.validated_data` property will include nested data structures. diff --git a/docs/api-guide/validators.md b/docs/api-guide/validators.md index e3407e8a3..16fb433d8 100644 --- a/docs/api-guide/validators.md +++ b/docs/api-guide/validators.md @@ -175,7 +175,7 @@ If you want the date field to be entirely hidden from the user, then use `Hidden Validators that are applied across multiple fields in the serializer can sometimes require a field input that should not be provided by the API client, but that *is* available as input to the validator. For this purposes use `HiddenField`. This field will be present in `validated_data` but *will not* be used in the serializer output representation. -**Note:** Using a `read_only=True` field is excluded from writable fields so it won't use a `default=…` argument. Look [3.8 announcement](https://www.django-rest-framework.org/community/3.8-announcement/#altered-the-behaviour-of-read_only-plus-default-on-field). +**Note:** Using a `read_only=True` field is excluded from writable fields so it won't use a `default=…` argument. Look [3.8 announcement](https://www.django-rest-framework.org/community/3.8-announcement/#altered-the-behavior-of-read_only-plus-default-on-field). REST framework includes a couple of defaults that may be useful in this context. diff --git a/docs/community/3.0-announcement.md b/docs/community/3.0-announcement.md index cec61f337..52acd10e2 100644 --- a/docs/community/3.0-announcement.md +++ b/docs/community/3.0-announcement.md @@ -632,7 +632,7 @@ The `MultipleChoiceField` class has been added. This field acts like `ChoiceFiel The `from_native(self, value)` and `to_native(self, data)` method names have been replaced with the more obviously named `to_internal_value(self, data)` and `to_representation(self, value)`. -The `field_from_native()` and `field_to_native()` methods are removed. Previously you could use these methods if you wanted to customise the behavior in a way that did not simply lookup the field value from the object. For example... +The `field_from_native()` and `field_to_native()` methods are removed. Previously you could use these methods if you wanted to customize the behavior in a way that did not simply lookup the field value from the object. For example... def field_to_native(self, obj, field_name): """A custom read-only field that returns the class name.""" diff --git a/docs/community/3.12-announcement.md b/docs/community/3.12-announcement.md index b192f7290..c0750ec06 100644 --- a/docs/community/3.12-announcement.md +++ b/docs/community/3.12-announcement.md @@ -50,7 +50,7 @@ See [the schema documentation](https://www.django-rest-framework.org/api-guide/s ## Customizing the operation ID. REST framework automatically determines operation IDs to use in OpenAPI -schemas. The latest version provides more control for overriding the behaviour +schemas. The latest version provides more control for overriding the behavior used to generate the operation IDs. See [the schema documentation](https://www.django-rest-framework.org/api-guide/schemas/#operationid) for more information. diff --git a/docs/community/3.13-announcement.md b/docs/community/3.13-announcement.md index e2c1fefa6..10d31b764 100644 --- a/docs/community/3.13-announcement.md +++ b/docs/community/3.13-announcement.md @@ -50,6 +50,6 @@ They must now use the more explicit keyword argument style... aliases = serializers.ListField(child=serializers.CharField()) ``` -This change has been made because using positional arguments here *does not* result in the expected behaviour. +This change has been made because using positional arguments here *does not* result in the expected behavior. See Pull Request [#7632](https://github.com/encode/django-rest-framework/pull/7632) for more details. diff --git a/docs/community/3.15-announcement.md b/docs/community/3.15-announcement.md index 848d534b2..fbe0c759b 100644 --- a/docs/community/3.15-announcement.md +++ b/docs/community/3.15-announcement.md @@ -39,12 +39,12 @@ By default the URLs created by `SimpleRouter` use regular expressions. This beha Dependency on pytz has been removed and deprecation warnings have been added, Django will provide ZoneInfo instances as long as USE_DEPRECATED_PYTZ is not enabled. More info on the migration can be found [in this guide](https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html). -## Align `SearchFilter` behaviour to `django.contrib.admin` search +## Align `SearchFilter` behavior to `django.contrib.admin` search Searches now may contain _quoted phrases_ with spaces, each phrase is considered as a single search term, and it will raise a validation error if any null-character is provided in search. See the [Filtering API guide](../api-guide/filtering.md) for more information. ## Other fixes and improvements -There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behaviour. +There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behavior. See the [release notes](release-notes.md) page for a complete listing. diff --git a/docs/community/3.16-announcement.md b/docs/community/3.16-announcement.md index b8f460ae7..97e102c09 100644 --- a/docs/community/3.16-announcement.md +++ b/docs/community/3.16-announcement.md @@ -29,7 +29,7 @@ The current minimum versions of Django is now 4.2 and Python 3.9. ## Django LoginRequiredMiddleware -The new `LoginRequiredMiddleware` introduced by Django 5.1 can now be used alongside Django REST Framework, however it is not honored for API views as an equivalent behaviour can be configured via `DEFAULT_AUTHENTICATION_CLASSES`. See [our dedicated section](../api-guide/authentication.md#django-51-loginrequiredmiddleware) in the docs for more information. +The new `LoginRequiredMiddleware` introduced by Django 5.1 can now be used alongside Django REST Framework, however it is not honored for API views as an equivalent behavior can be configured via `DEFAULT_AUTHENTICATION_CLASSES`. See [our dedicated section](../api-guide/authentication.md#django-51-loginrequiredmiddleware) in the docs for more information. ## Improved support for UniqueConstraint @@ -37,6 +37,6 @@ The generation of validators for [UniqueConstraint](https://docs.djangoproject.c ## Other fixes and improvements -There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behaviour. +There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behavior. See the [release notes](release-notes.md) page for a complete listing. diff --git a/docs/community/3.5-announcement.md b/docs/community/3.5-announcement.md index de558fead..2dc2ee411 100644 --- a/docs/community/3.5-announcement.md +++ b/docs/community/3.5-announcement.md @@ -81,7 +81,7 @@ a dynamic client library to interact with your API. Finally, we're also now exposing the schema generation as a [publicly documented API][schema-generation-api], allowing you to more easily -override the behaviour. +override the behavior. ## Requests test client @@ -204,10 +204,10 @@ The `'pk'` identifier in schema paths is now mapped onto the actually model fiel name by default. This will typically be `'id'`. This gives a better external representation for schemas, with less implementation -detail being exposed. It also reflects the behaviour of using a ModelSerializer +detail being exposed. It also reflects the behavior of using a ModelSerializer class with `fields = '__all__'`. -You can revert to the previous behaviour by setting `'SCHEMA_COERCE_PATH_PK': False` +You can revert to the previous behavior by setting `'SCHEMA_COERCE_PATH_PK': False` in the REST framework settings. ### Schema action name representations @@ -215,7 +215,7 @@ in the REST framework settings. The internal `retrieve()` and `destroy()` method names are now coerced to an external representation of `read` and `delete`. -You can revert to the previous behaviour by setting `'SCHEMA_COERCE_METHOD_NAMES': {}` +You can revert to the previous behavior by setting `'SCHEMA_COERCE_METHOD_NAMES': {}` in the REST framework settings. ### DjangoFilterBackend diff --git a/docs/community/3.7-announcement.md b/docs/community/3.7-announcement.md index d1a39fa60..49f68ead2 100644 --- a/docs/community/3.7-announcement.md +++ b/docs/community/3.7-announcement.md @@ -53,7 +53,7 @@ In order to try to address this we're now adding the ability for per-view custom Let's take a quick look at using the new functionality... -The `APIView` class has a `schema` attribute, that is used to control how the Schema for that particular view is generated. The default behaviour is to use the `AutoSchema` class. +The `APIView` class has a `schema` attribute, that is used to control how the Schema for that particular view is generated. The default behavior is to use the `AutoSchema` class. from rest_framework.views import APIView from rest_framework.schemas import AutoSchema diff --git a/docs/community/3.8-announcement.md b/docs/community/3.8-announcement.md index f33b220fd..eef3ae0c9 100644 --- a/docs/community/3.8-announcement.md +++ b/docs/community/3.8-announcement.md @@ -36,7 +36,7 @@ If you use REST framework commercially and would like to see this work continue, ## Breaking Changes -### Altered the behaviour of `read_only` plus `default` on Field. +### Altered the behavior of `read_only` plus `default` on Field. [#5886][gh5886] `read_only` fields will now **always** be excluded from writable fields. @@ -44,7 +44,7 @@ Previously `read_only` fields when combined with a `default` value would use the operations. This was counter-intuitive in some circumstances and led to difficulties supporting dotted `source` attributes on nullable relations. -In order to maintain the old behaviour you may need to pass the value of `read_only` fields when calling `save()` in +In order to maintain the old behavior you may need to pass the value of `read_only` fields when calling `save()` in the view: def perform_create(self, serializer): diff --git a/docs/community/release-notes.md b/docs/community/release-notes.md index ae59ae000..fed9bc7d1 100644 --- a/docs/community/release-notes.md +++ b/docs/community/release-notes.md @@ -105,7 +105,7 @@ This release fixes a few bugs, clean-up some old code paths for unsupported Pyth **Date**: 28th March 2025 -This release is considered a significant release to improve upstream support with Django and Python. Some of these may change the behaviour of existing features and pre-existing behaviour. Specifically, some fixes were added to around the support of `UniqueConstraint` with nullable fields which will improve built-in serializer validation. +This release is considered a significant release to improve upstream support with Django and Python. Some of these may change the behavior of existing features and pre-existing behavior. Specifically, some fixes were added to around the support of `UniqueConstraint` with nullable fields which will improve built-in serializer validation. #### Features @@ -215,7 +215,7 @@ Date: 15th March 2024 * Partial serializer should not have required fields [[#7563](https://github.com/encode/django-rest-framework/pull/7563)] * Propagate 'default' from model field to serializer field. [[#9030](https://github.com/encode/django-rest-framework/pull/9030)] * Allow to override child.run_validation call in ListSerializer [[#8035](https://github.com/encode/django-rest-framework/pull/8035)] -* Align SearchFilter behaviour to django.contrib.admin search [[#9017](https://github.com/encode/django-rest-framework/pull/9017)] +* Align SearchFilter behavior to django.contrib.admin search [[#9017](https://github.com/encode/django-rest-framework/pull/9017)] * Class name added to unknown field error [[#9019](https://github.com/encode/django-rest-framework/pull/9019)] * Fix: Pagination response schemas. [[#9049](https://github.com/encode/django-rest-framework/pull/9049)] * Fix choices in ChoiceField to support IntEnum [[#8955](https://github.com/encode/django-rest-framework/pull/8955)] @@ -621,13 +621,13 @@ Be sure to upgrade to Python 3 before upgrading to Django REST Framework 3.10. **Date**: [3rd April 2018][3.8.0-milestone] -* **Breaking Change**: Alter `read_only` plus `default` behaviour. [#5886][gh5886] +* **Breaking Change**: Alter `read_only` plus `default` behavior. [#5886][gh5886] `read_only` fields will now **always** be excluded from writable fields. Previously `read_only` fields with a `default` value would use the `default` for create and update operations. - In order to maintain the old behaviour you may need to pass the value of `read_only` fields when calling `save()` in + In order to maintain the old behavior you may need to pass the value of `read_only` fields when calling `save()` in the view: def perform_create(self, serializer): @@ -635,13 +635,13 @@ Be sure to upgrade to Python 3 before upgrading to Django REST Framework 3.10. Alternatively you may override `save()` or `create()` or `update()` on the serializer as appropriate. -* Correct allow_null behaviour when required=False [#5888][gh5888] +* Correct allow_null behavior when required=False [#5888][gh5888] Without an explicit `default`, `allow_null` implies a default of `null` for outgoing serialization. Previously such fields were being skipped when read-only or otherwise not required. **Possible backwards compatibility break** if you were relying on such fields being excluded from the outgoing - representation. In order to restore the old behaviour you can override `data` to exclude the field when `None`. + representation. In order to restore the old behavior you can override `data` to exclude the field when `None`. For example: @@ -883,7 +883,7 @@ Be sure to upgrade to Python 3 before upgrading to Django REST Framework 3.10. * Don't strip microseconds from `time` when encoding. Makes consistent with `datetime`. **BC Change**: Previously only milliseconds were encoded. [#5440][gh5440] * Added `STRICT_JSON` setting (default `True`) to raise exception for the extended float values (`nan`, `inf`, `-inf`) accepted by Python's `json` module. - **BC Change**: Previously these values would converted to corresponding strings. Set `STRICT_JSON` to `False` to restore the previous behaviour. [#5265][gh5265] + **BC Change**: Previously these values would converted to corresponding strings. Set `STRICT_JSON` to `False` to restore the previous behavior. [#5265][gh5265] * Add support for `page_size` parameter in CursorPaginator class [#5250][gh5250] * Make `DEFAULT_PAGINATION_CLASS` `None` by default. **BC Change**: If your were **just** setting `PAGE_SIZE` to enable pagination you will need to add `DEFAULT_PAGINATION_CLASS`. diff --git a/docs/topics/browsable-api.md b/docs/topics/browsable-api.md index 8cf530b7a..dd2da6877 100644 --- a/docs/topics/browsable-api.md +++ b/docs/topics/browsable-api.md @@ -181,7 +181,7 @@ The context that's available to the template: * `FORMAT_PARAM` : The view can accept a format override * `METHOD_PARAM` : The view can accept a method override -You can override the `BrowsableAPIRenderer.get_context()` method to customise the context that gets passed to the template. +You can override the `BrowsableAPIRenderer.get_context()` method to customize the context that gets passed to the template. #### Not using base.html diff --git a/rest_framework/filters.py b/rest_framework/filters.py index 3f4730da8..3a173e425 100644 --- a/rest_framework/filters.py +++ b/rest_framework/filters.py @@ -75,7 +75,7 @@ class SearchFilter(BaseFilterBackend): def get_search_fields(self, view, request): """ Search fields are obtained from the view, but the request is always - passed to this method. Sub-classes can override this method to + passed to this method. Subclasses can override this method to dynamically change the search fields based on request content. """ return getattr(view, 'search_fields', None) diff --git a/rest_framework/generics.py b/rest_framework/generics.py index 167303321..ca35dcf15 100644 --- a/rest_framework/generics.py +++ b/rest_framework/generics.py @@ -1,5 +1,5 @@ """ -Generic views that provide commonly needed behaviour. +Generic views that provide commonly needed behavior. """ from django.core.exceptions import ValidationError from django.db.models.query import QuerySet diff --git a/rest_framework/mixins.py b/rest_framework/mixins.py index 7fa8947cb..00487450b 100644 --- a/rest_framework/mixins.py +++ b/rest_framework/mixins.py @@ -1,7 +1,7 @@ """ Basic building blocks for generic class based views. -We don't bind behaviour to http method handlers yet, +We don't bind behavior to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ from rest_framework import status diff --git a/rest_framework/schemas/coreapi.py b/rest_framework/schemas/coreapi.py index 657178304..5d6244fea 100644 --- a/rest_framework/schemas/coreapi.py +++ b/rest_framework/schemas/coreapi.py @@ -50,7 +50,7 @@ Position conflicts with coreapi.Link for URL path {target_url}. Attempted to insert link with keys: {keys}. Adjust URLs to avoid naming collision or override `SchemaGenerator.get_keys()` -to customise schema structure. +to customize schema structure. """ @@ -153,7 +153,7 @@ class SchemaGenerator(BaseSchemaGenerator): """ Generate a `coreapi.Document` representing the API schema. """ - self._initialise_endpoints() + self._initialize_endpoints() links = self.get_links(None if public else request) if not links: @@ -513,7 +513,7 @@ class AutoSchema(ViewInspector): Default implementation looks for ModelViewSet or GenericAPIView actions/methods that cause filtering on the default implementation. - Override to adjust behaviour for your view. + Override to adjust behavior for your view. Note: Introduced in v3.7: Initially "private" (i.e. with leading underscore) to allow changes based on user experience. diff --git a/rest_framework/schemas/generators.py b/rest_framework/schemas/generators.py index f59e25c21..54c308c58 100644 --- a/rest_framework/schemas/generators.py +++ b/rest_framework/schemas/generators.py @@ -165,7 +165,7 @@ class BaseSchemaGenerator: self.url = url self.endpoints = None - def _initialise_endpoints(self): + def _initialize_endpoints(self): if self.endpoints is None: inspector = self.endpoint_inspector_cls(self.patterns, self.urlconf) self.endpoints = inspector.get_api_endpoints() diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index e569e2501..8c2cbafbd 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -65,7 +65,7 @@ class SchemaGenerator(BaseSchemaGenerator): """ Generate a OpenAPI schema. """ - self._initialise_endpoints() + self._initialize_endpoints() components_schemas = {} # Iterate endpoints generating per method path operations. diff --git a/tests/browsable_api/test_browsable_api.py b/tests/browsable_api/test_browsable_api.py index 758e3d1a4..9df4b2f5f 100644 --- a/tests/browsable_api/test_browsable_api.py +++ b/tests/browsable_api/test_browsable_api.py @@ -33,7 +33,7 @@ class AnonymousUserTests(TestCase): @override_settings(ROOT_URLCONF='tests.browsable_api.auth_urls') class DropdownWithAuthTests(TestCase): - """Tests correct dropdown behaviour with Auth views enabled.""" + """Tests correct dropdown behavior with Auth views enabled.""" def setUp(self): self.client = APIClient(enforce_csrf_checks=True) self.username = 'john' @@ -74,7 +74,7 @@ class DropdownWithAuthTests(TestCase): @override_settings(ROOT_URLCONF='tests.browsable_api.no_auth_urls') class NoDropdownWithoutAuthTests(TestCase): - """Tests correct dropdown behaviour with Auth views NOT enabled.""" + """Tests correct dropdown behavior with Auth views NOT enabled.""" def setUp(self): self.client = APIClient(enforce_csrf_checks=True) self.username = 'john' diff --git a/tests/browsable_api/test_browsable_nested_api.py b/tests/browsable_api/test_browsable_nested_api.py index a6c2ee6bd..9ef7605d6 100644 --- a/tests/browsable_api/test_browsable_nested_api.py +++ b/tests/browsable_api/test_browsable_nested_api.py @@ -28,7 +28,7 @@ urlpatterns = [ class DropdownWithAuthTests(TestCase): - """Tests correct dropdown behaviour with Auth views enabled.""" + """Tests correct dropdown behavior with Auth views enabled.""" @override_settings(ROOT_URLCONF='tests.browsable_api.test_browsable_nested_api') def test_login(self): diff --git a/tests/schemas/test_openapi.py b/tests/schemas/test_openapi.py index a168cb466..e81e3c669 100644 --- a/tests/schemas/test_openapi.py +++ b/tests/schemas/test_openapi.py @@ -1149,7 +1149,7 @@ class TestGenerator(TestCase): path('example/', views.ExampleListView.as_view()), ] generator = SchemaGenerator(patterns=patterns) - generator._initialise_endpoints() + generator._initialize_endpoints() paths = generator.get_schema()["paths"] @@ -1166,7 +1166,7 @@ class TestGenerator(TestCase): path('v1/example/{pk}/', views.ExampleDetailView.as_view()), ] generator = SchemaGenerator(patterns=patterns) - generator._initialise_endpoints() + generator._initialize_endpoints() paths = generator.get_schema()["paths"] @@ -1179,7 +1179,7 @@ class TestGenerator(TestCase): path('example/{pk}/', views.ExampleDetailView.as_view()), ] generator = SchemaGenerator(patterns=patterns, url='/api') - generator._initialise_endpoints() + generator._initialize_endpoints() paths = generator.get_schema()["paths"] diff --git a/tests/test_fields.py b/tests/test_fields.py index b52442a2c..03ff366ae 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -332,7 +332,7 @@ class TestInitialWithCallable: def test_initial_should_accept_callable(self): """ - Follows the default ``Field.initial`` behaviour where they accept a + Follows the default ``Field.initial`` behavior where they accept a callable to produce the initial value""" assert self.serializer.data == { 'initial_field': 123, diff --git a/tests/test_request.py b/tests/test_request.py index fe3efd96b..75b460cb8 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -52,14 +52,14 @@ class PlainTextParser(BaseParser): class TestContentParsing(TestCase): - def test_standard_behaviour_determines_no_content_GET(self): + def test_standard_behavior_determines_no_content_GET(self): """ Ensure request.data returns empty QueryDict for GET request. """ request = Request(factory.get('/')) assert request.data == {} - def test_standard_behaviour_determines_no_content_HEAD(self): + def test_standard_behavior_determines_no_content_HEAD(self): """ Ensure request.data returns empty QueryDict for HEAD request. """ @@ -105,7 +105,7 @@ class TestContentParsing(TestCase): assert list(request.POST) == [] assert list(request.FILES) == ['upload'] - def test_standard_behaviour_determines_form_content_PUT(self): + def test_standard_behavior_determines_form_content_PUT(self): """ Ensure request.data returns content for PUT request with form content. """ @@ -114,7 +114,7 @@ class TestContentParsing(TestCase): request.parsers = (FormParser(), MultiPartParser()) assert list(request.data.items()) == list(data.items()) - def test_standard_behaviour_determines_non_form_content_PUT(self): + def test_standard_behavior_determines_non_form_content_PUT(self): """ Ensure request.data returns content for PUT request with non-form content. diff --git a/tests/test_serializer_lists.py b/tests/test_serializer_lists.py index 42ebf4771..f76451a5a 100644 --- a/tests/test_serializer_lists.py +++ b/tests/test_serializer_lists.py @@ -287,7 +287,7 @@ class TestNestedListSerializer: class TestNestedListSerializerAllowEmpty: - """Tests the behaviour of allow_empty=False when a ListSerializer is used as a field.""" + """Tests the behavior of allow_empty=False when a ListSerializer is used as a field.""" @pytest.mark.parametrize('partial', (False, True)) def test_allow_empty_true(self, partial): @@ -643,7 +643,7 @@ class TestSerializerPartialUsage: class TestEmptyListSerializer: """ - Tests the behaviour of ListSerializers when there is no data passed to it + Tests the behavior of ListSerializers when there is no data passed to it """ def setup_method(self): @@ -672,7 +672,7 @@ class TestEmptyListSerializer: class TestMaxMinLengthListSerializer: """ - Tests the behaviour of ListSerializers when max_length and min_length are used + Tests the behavior of ListSerializers when max_length and min_length are used """ def setup_method(self):