summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2025-04-15 14:24:12 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-04-16 10:21:38 +0200
commit6ef0f5bc272b316f0fd6fa706d7eaf8f1822faa4 (patch)
tree499b867d39644712dd26643bbe1fa5a9da518248
parent494d2dc316fc1d849b6a1af97575d293f856a84c (diff)
Americanized some spellings.
-rw-r--r--django/contrib/postgres/aggregates/general.py2
-rw-r--r--django/db/migrations/migration.py4
-rw-r--r--docs/man/django-admin.12
-rw-r--r--docs/ref/django-admin.txt2
-rw-r--r--tests/admin_views/tests.py6
-rw-r--r--tests/custom_lookups/tests.py2
-rw-r--r--tests/foreign_object/tests.py2
-rw-r--r--tests/model_forms/models.py6
-rw-r--r--tests/model_forms/tests.py46
-rw-r--r--tests/postgres_tests/test_aggregates.py2
-rw-r--r--tests/sitemaps_tests/templates/custom_sitemap.xml2
-rw-r--r--tests/sitemaps_tests/templates/custom_sitemap_lastmod_index.xml2
-rw-r--r--tests/sitemaps_tests/test_http.py4
13 files changed, 41 insertions, 41 deletions
diff --git a/django/contrib/postgres/aggregates/general.py b/django/contrib/postgres/aggregates/general.py
index 153b0242e3..b2ecd18ffb 100644
--- a/django/contrib/postgres/aggregates/general.py
+++ b/django/contrib/postgres/aggregates/general.py
@@ -73,7 +73,7 @@ class StringAgg(_DeprecatedOrdering, _StringAgg):
warnings.warn(
"delimiter: str will be resolved as a field reference instead "
"of a string literal on Django 7.0. Pass "
- f"`delimiter=Value({delimiter!r})` to preserve the previous behaviour.",
+ f"`delimiter=Value({delimiter!r})` to preserve the previous behavior.",
category=RemovedInDjango70Warning,
stacklevel=2,
)
diff --git a/django/db/migrations/migration.py b/django/db/migrations/migration.py
index 3c7713c5ea..2041a28780 100644
--- a/django/db/migrations/migration.py
+++ b/django/db/migrations/migration.py
@@ -128,7 +128,7 @@ class Migration:
self.app_label, schema_editor, old_state, project_state
)
else:
- # Normal behaviour
+ # Normal behavior
operation.database_forwards(
self.app_label, schema_editor, old_state, project_state
)
@@ -189,7 +189,7 @@ class Migration:
self.app_label, schema_editor, from_state, to_state
)
else:
- # Normal behaviour
+ # Normal behavior
operation.database_backwards(
self.app_label, schema_editor, from_state, to_state
)
diff --git a/docs/man/django-admin.1 b/docs/man/django-admin.1
index 7a544fb276..67c4855e63 100644
--- a/docs/man/django-admin.1
+++ b/docs/man/django-admin.1
@@ -1379,7 +1379,7 @@ precedence. For a \fB\-\-verbosity\fP of 2 or higher, the automatically imported
objects will be listed. To disable automatic importing entirely, use the
\fB\-\-no\-imports\fP flag.
.sp
-See the guide on \fI\%customizing this behaviour\fP to add or remove automatic imports.
+See the guide on \fI\%customizing this behavior\fP to add or remove automatic imports.
.sp
Automatic models import was added.
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index d401b83893..74413b78f9 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -1071,7 +1071,7 @@ precedence. For a ``--verbosity`` of 2 or higher, the automatically imported
objects will be listed. To disable automatic importing entirely, use the
``--no-imports`` flag.
-See the guide on :ref:`customizing this behaviour
+See the guide on :ref:`customizing this behavior
<customizing-shell-auto-imports>` to add or remove automatic imports.
.. versionchanged:: 5.2
diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py
index b79b4a94a4..637f258ec0 100644
--- a/tests/admin_views/tests.py
+++ b/tests/admin_views/tests.py
@@ -1940,9 +1940,9 @@ class AdminViewFormUrlTest(TestCase):
reverse("admin:admin_views_restaurant_add", current_app=self.current_app),
{"name": "test_value"},
)
- # this would be the usual behaviour
+ # this would be the usual behavior
self.assertNotContains(response, 'value="test_value"')
- # this is the overridden behaviour
+ # this is the overridden behavior
self.assertContains(response, 'value="overridden_value"')
@@ -8806,7 +8806,7 @@ class GetFormsetsWithInlinesArgumentTest(TestCase):
@override_settings(ROOT_URLCONF="admin_views.urls")
class AdminSiteFinalCatchAllPatternTests(TestCase):
"""
- Verifies the behaviour of the admin catch-all view.
+ Verifies the behavior of the admin catch-all view.
* Anonynous/non-staff users are redirected to login for all URLs, whether
otherwise valid or not.
diff --git a/tests/custom_lookups/tests.py b/tests/custom_lookups/tests.py
index 2f4ea0a9a0..cc6f5c7f8f 100644
--- a/tests/custom_lookups/tests.py
+++ b/tests/custom_lookups/tests.py
@@ -631,7 +631,7 @@ class LookupTransformCallOrderTests(SimpleTestCase):
self.assertEqual(TrackCallsYearTransform.call_order, ["lookup"])
-class CustomisedMethodsTests(SimpleTestCase):
+class CustomizedMethodsTests(SimpleTestCase):
def test_overridden_get_lookup(self):
q = CustomModel.objects.filter(field__lookupfunc_monkeys=3)
self.assertIn("monkeys()", str(q.query))
diff --git a/tests/foreign_object/tests.py b/tests/foreign_object/tests.py
index 00b6a8350e..7670330995 100644
--- a/tests/foreign_object/tests.py
+++ b/tests/foreign_object/tests.py
@@ -731,7 +731,7 @@ class TestCachedPathInfo(TestCase):
ForeignObjectRel implements __getstate__(), so copy and pickle modules
both use that, but ForeignObject implements __reduce__() and __copy__()
- separately, so doesn't share the same behaviour.
+ separately, so doesn't share the same behavior.
"""
foreign_object_rel = Membership._meta.get_field("person").remote_field
# Trigger storage of cached_property into ForeignObjectRel's __dict__.
diff --git a/tests/model_forms/models.py b/tests/model_forms/models.py
index 4111fafd69..6d984379f0 100644
--- a/tests/model_forms/models.py
+++ b/tests/model_forms/models.py
@@ -374,7 +374,7 @@ class FlexibleDatePost(models.Model):
posted = models.DateField(blank=True, null=True)
-class Colour(models.Model):
+class Color(models.Model):
name = models.CharField(max_length=50)
def __iter__(self):
@@ -384,9 +384,9 @@ class Colour(models.Model):
return self.name
-class ColourfulItem(models.Model):
+class ColorfulItem(models.Model):
name = models.CharField(max_length=50)
- colours = models.ManyToManyField(Colour)
+ colors = models.ManyToManyField(Color)
class CustomErrorMessage(models.Model):
diff --git a/tests/model_forms/tests.py b/tests/model_forms/tests.py
index 837466f07f..59e5ee0242 100644
--- a/tests/model_forms/tests.py
+++ b/tests/model_forms/tests.py
@@ -38,8 +38,8 @@ from .models import (
Book,
Category,
Character,
- Colour,
- ColourfulItem,
+ Color,
+ ColorfulItem,
ConstraintsModel,
CustomErrorMessage,
CustomFF,
@@ -2998,18 +2998,18 @@ class OtherModelFormTests(TestCase):
"""
ModelChoiceField should respect a prefetch_related() on its queryset.
"""
- blue = Colour.objects.create(name="blue")
- red = Colour.objects.create(name="red")
- multicolor_item = ColourfulItem.objects.create()
- multicolor_item.colours.add(blue, red)
- red_item = ColourfulItem.objects.create()
- red_item.colours.add(red)
+ blue = Color.objects.create(name="blue")
+ red = Color.objects.create(name="red")
+ multicolor_item = ColorfulItem.objects.create()
+ multicolor_item.colors.add(blue, red)
+ red_item = ColorfulItem.objects.create()
+ red_item.colors.add(red)
class ColorModelChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
- return ", ".join(c.name for c in obj.colours.all())
+ return ", ".join(c.name for c in obj.colors.all())
- field = ColorModelChoiceField(ColourfulItem.objects.prefetch_related("colours"))
+ field = ColorModelChoiceField(ColorfulItem.objects.prefetch_related("colors"))
# CPython < 3.14 calls ModelChoiceField.__len__() when coercing to
# tuple. PyPy and Python 3.14+ don't call __len__() and so .count()
# isn't called on the QuerySet. The following would trigger an extra
@@ -3091,13 +3091,13 @@ class OtherModelFormTests(TestCase):
)
def test_iterable_model_m2m(self):
- class ColourfulItemForm(forms.ModelForm):
+ class ColorfulItemForm(forms.ModelForm):
class Meta:
- model = ColourfulItem
+ model = ColorfulItem
fields = "__all__"
- colour = Colour.objects.create(name="Blue")
- form = ColourfulItemForm()
+ color = Color.objects.create(name="Blue")
+ form = ColorfulItemForm()
self.maxDiff = 1024
self.assertHTMLEqual(
form.as_p(),
@@ -3105,12 +3105,12 @@ class OtherModelFormTests(TestCase):
<p>
<label for="id_name">Name:</label>
<input id="id_name" type="text" name="name" maxlength="50" required></p>
- <p><label for="id_colours">Colours:</label>
- <select multiple name="colours" id="id_colours" required>
+ <p><label for="id_colors">Colors:</label>
+ <select multiple name="colors" id="id_colors" required>
<option value="%(blue_pk)s">Blue</option>
</select></p>
"""
- % {"blue_pk": colour.pk},
+ % {"blue_pk": color.pk},
)
def test_callable_field_default(self):
@@ -3709,13 +3709,13 @@ class StrictAssignmentTests(SimpleTestCase):
class ModelToDictTests(TestCase):
def test_many_to_many(self):
"""Data for a ManyToManyField is a list rather than a lazy QuerySet."""
- blue = Colour.objects.create(name="blue")
- red = Colour.objects.create(name="red")
- item = ColourfulItem.objects.create()
- item.colours.set([blue])
- data = model_to_dict(item)["colours"]
+ blue = Color.objects.create(name="blue")
+ red = Color.objects.create(name="red")
+ item = ColorfulItem.objects.create()
+ item.colors.set([blue])
+ data = model_to_dict(item)["colors"]
self.assertEqual(data, [blue])
- item.colours.set([red])
+ item.colors.set([red])
# If data were a QuerySet, it would be reevaluated here and give "red"
# instead of the original value.
self.assertEqual(data, [blue])
diff --git a/tests/postgres_tests/test_aggregates.py b/tests/postgres_tests/test_aggregates.py
index 56544d99e5..ae386b6659 100644
--- a/tests/postgres_tests/test_aggregates.py
+++ b/tests/postgres_tests/test_aggregates.py
@@ -658,7 +658,7 @@ class TestGeneralAggregate(PostgreSQLTestCase):
msg = (
"delimiter: str will be resolved as a field reference instead "
'of a string literal on Django 7.0. Pass `delimiter=Value("\'")` to '
- "preserve the previous behaviour."
+ "preserve the previous behavior."
)
with self.assertWarnsMessage(RemovedInDjango70Warning, msg) as ctx:
diff --git a/tests/sitemaps_tests/templates/custom_sitemap.xml b/tests/sitemaps_tests/templates/custom_sitemap.xml
index 594aef1a3e..f10f33023b 100644
--- a/tests/sitemaps_tests/templates/custom_sitemap.xml
+++ b/tests/sitemaps_tests/templates/custom_sitemap.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a customised template -->
+<!-- This is a customized template -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% spaceless %}
{% for url in urlset %}
diff --git a/tests/sitemaps_tests/templates/custom_sitemap_lastmod_index.xml b/tests/sitemaps_tests/templates/custom_sitemap_lastmod_index.xml
index dcf5e32584..31a59b7460 100644
--- a/tests/sitemaps_tests/templates/custom_sitemap_lastmod_index.xml
+++ b/tests/sitemaps_tests/templates/custom_sitemap_lastmod_index.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a customised template -->
+<!-- This is a customized template -->
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% spaceless %}
{% for site in sitemaps %}
diff --git a/tests/sitemaps_tests/test_http.py b/tests/sitemaps_tests/test_http.py
index 6ae7e0d7c4..b62060c0c6 100644
--- a/tests/sitemaps_tests/test_http.py
+++ b/tests/sitemaps_tests/test_http.py
@@ -68,7 +68,7 @@ class HTTPSitemapTests(SitemapTestsBase):
"A simple sitemap index can be rendered with a custom template"
response = self.client.get("/simple/custom-lastmod-index.xml")
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a customised template -->
+<!-- This is a customized template -->
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap><loc>%s/simple/sitemap-simple.xml</loc><lastmod>%s</lastmod></sitemap>
</sitemapindex>
@@ -140,7 +140,7 @@ class HTTPSitemapTests(SitemapTestsBase):
"A simple sitemap can be rendered with a custom template"
response = self.client.get("/simple/custom-sitemap.xml")
expected_content = """<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a customised template -->
+<!-- This is a customized template -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>%s/location/</loc><lastmod>%s</lastmod><changefreq>never</changefreq><priority>0.5</priority></url>
</urlset>