From 469903c9eb4806467c81697ba6bd44bf441becc2 Mon Sep 17 00:00:00 2001 From: Lebaud Antoine Date: Thu, 15 Feb 2024 20:26:19 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F(project)=20fix=20minor=20typ?= =?UTF-8?q?os?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found typos, fixed them. --- README.md | 2 +- src/backend/core/models.py | 2 +- src/backend/core/tests/test_api_contacts.py | 2 +- .../core/tests/test_models_contacts.py | 2 +- .../core/tests/test_models_identities.py | 28 +++++++++---------- src/backend/core/tests/test_models_users.py | 4 +-- src/backend/core/tokens.py | 2 +- src/backend/people/settings.py | 4 +-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 9b7ef45..7ba2b6b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ People is an application to handle users and teams. -This project is as of yet **not ready for production**. Expect breaking changes. +As of today, this project is **not yet ready for production**. Expect breaking changes. People is built on top of [Django Rest Framework](https://www.django-rest-framework.org/). diff --git a/src/backend/core/models.py b/src/backend/core/models.py index a6c267e..47a6aff 100644 --- a/src/backend/core/models.py +++ b/src/backend/core/models.py @@ -229,7 +229,7 @@ class User(AbstractBaseUser, BaseModel, auth_models.PermissionsMixin): ) def email_user(self, subject, message, from_email=None, **kwargs): - """Send an email to this user.""" + """Email this user.""" main_identity = self.identities.get(is_main=True) mail.send_mail(subject, message, from_email, [main_identity.email], **kwargs) diff --git a/src/backend/core/tests/test_api_contacts.py b/src/backend/core/tests/test_api_contacts.py index 59f1280..ca37d75 100644 --- a/src/backend/core/tests/test_api_contacts.py +++ b/src/backend/core/tests/test_api_contacts.py @@ -511,7 +511,7 @@ def test_api_contacts_update_authenticated_owned(): def test_api_contacts_update_authenticated_profile(): """ - Authenticated users should be allowed to update their prodile contact. + Authenticated users should be allowed to update their profile contact. """ identity = factories.IdentityFactory() user = identity.user diff --git a/src/backend/core/tests/test_models_contacts.py b/src/backend/core/tests/test_models_contacts.py index 68756e6..85d9860 100644 --- a/src/backend/core/tests/test_models_contacts.py +++ b/src/backend/core/tests/test_models_contacts.py @@ -52,7 +52,7 @@ def test_models_contacts_base_to_base(): def test_models_contacts_owner_base_unique(): - """Their should be only one contact deriving from a given base contact for a given owner.""" + """There should be only one contact deriving from a given base contact for a given owner.""" contact = factories.ContactFactory() with pytest.raises(ValidationError) as excinfo: diff --git a/src/backend/core/tests/test_models_identities.py b/src/backend/core/tests/test_models_identities.py index cf155d7..4d8c8b7 100644 --- a/src/backend/core/tests/test_models_identities.py +++ b/src/backend/core/tests/test_models_identities.py @@ -70,19 +70,19 @@ def test_models_identities_is_main_switch(): def test_models_identities_email_not_required(): - """The "email" field can be blank.""" + """The 'email' field can be blank.""" user = factories.UserFactory() models.Identity.objects.create(user=user, sub="123", email=None) def test_models_identities_user_required(): - """The "user" field is required.""" + """The 'user' field is required.""" with pytest.raises(models.User.DoesNotExist, match="Identity has no user."): models.Identity.objects.create(user=None, email="david@example.com") def test_models_identities_email_unique_same_user(): - """The "email" field should be unique for a given user.""" + """The 'email' field should be unique for a given user.""" email = factories.IdentityFactory() with pytest.raises( @@ -93,13 +93,13 @@ def test_models_identities_email_unique_same_user(): def test_models_identities_email_unique_different_users(): - """The "email" field should not be unique among users.""" + """The 'email' field should not be unique among users.""" email = factories.IdentityFactory() factories.IdentityFactory(email=email.email) def test_models_identities_email_normalization(): - """The email field should be automatically normalized upon saving.""" + """The 'email' field should be automatically normalized upon saving.""" email = factories.IdentityFactory() email.email = "Thomas.Jefferson@Example.com" email.save() @@ -107,7 +107,7 @@ def test_models_identities_email_normalization(): def test_models_identities_ordering(): - """Identitys should be returned ordered by main status then by their email address.""" + """Identities should be returned ordered by main status then by their email address.""" user = factories.UserFactory() factories.IdentityFactory.create_batch(5, user=user) @@ -120,21 +120,21 @@ def test_models_identities_ordering(): def test_models_identities_sub_null(): - """The "sub" field should not be null.""" + """The 'sub' field should not be null.""" user = factories.UserFactory() with pytest.raises(ValidationError, match="This field cannot be null."): models.Identity.objects.create(user=user, sub=None) def test_models_identities_sub_blank(): - """The "sub" field should not be blank.""" + """The 'sub' field should not be blank.""" user = factories.UserFactory() with pytest.raises(ValidationError, match="This field cannot be blank."): models.Identity.objects.create(user=user, email="david@example.com", sub="") def test_models_identities_sub_unique(): - """The "sub" field should be unique.""" + """The 'sub' field should be unique.""" user = factories.UserFactory() identity = factories.IdentityFactory() with pytest.raises(ValidationError, match="Identity with this Sub already exists."): @@ -142,7 +142,7 @@ def test_models_identities_sub_unique(): def test_models_identities_sub_max_length(): - """The sub field should be 255 characters maximum.""" + """The 'sub' field should be 255 characters maximum.""" factories.IdentityFactory(sub="a" * 255) with pytest.raises(ValidationError) as excinfo: factories.IdentityFactory(sub="a" * 256) @@ -154,13 +154,13 @@ def test_models_identities_sub_max_length(): def test_models_identities_sub_special_characters(): - """The sub field should accept periods, dashes, +, @ and underscores.""" + """The 'sub' field should accept periods, dashes, +, @ and underscores.""" identity = factories.IdentityFactory(sub="dave.bowman-1+2@hal_9000") assert identity.sub == "dave.bowman-1+2@hal_9000" def test_models_identities_sub_spaces(): - """The sub field should not accept spaces.""" + """The 'sub' field should not accept spaces.""" with pytest.raises(ValidationError) as excinfo: factories.IdentityFactory(sub="a b") @@ -171,12 +171,12 @@ def test_models_identities_sub_spaces(): def test_models_identities_sub_upper_case(): - """The sub field should accept upper case characters.""" + """The 'sub' field should accept upper case characters.""" identity = factories.IdentityFactory(sub="John") assert identity.sub == "John" def test_models_identities_sub_ascii(): - """The sub field should accept non ASCII letters.""" + """The 'sub' field should accept non ASCII letters.""" identity = factories.IdentityFactory(sub="rené") assert identity.sub == "rené" diff --git a/src/backend/core/tests/test_models_users.py b/src/backend/core/tests/test_models_users.py index 107b32d..0f1ca14 100644 --- a/src/backend/core/tests/test_models_users.py +++ b/src/backend/core/tests/test_models_users.py @@ -77,7 +77,7 @@ def test_models_users_profile_owned_by_other(): def test_models_users_send_mail_main_existing(): - """The "email_user' method should send mail to the user's main email address.""" + """The 'email_user' method should send mail to the user's main email address.""" main_email = factories.IdentityFactory(email="dave@example.com") user = main_email.user factories.IdentityFactory.create_batch(2, user=user) @@ -91,7 +91,7 @@ def test_models_users_send_mail_main_existing(): def test_models_users_send_mail_main_missing(): - """The "email_user' method should fail if the user has no email address.""" + """The 'email_user' method should fail if the user has no email address.""" user = factories.UserFactory() with pytest.raises(models.Identity.DoesNotExist) as excinfo: diff --git a/src/backend/core/tokens.py b/src/backend/core/tokens.py index 0867868..8b054b4 100644 --- a/src/backend/core/tokens.py +++ b/src/backend/core/tokens.py @@ -1,4 +1,4 @@ -"""Tokens for Magnify's core app.""" +"""Tokens for People's core app.""" from rest_framework_simplejwt.settings import api_settings from rest_framework_simplejwt.tokens import Token diff --git a/src/backend/people/settings.py b/src/backend/people/settings.py index d057c11..88fa773 100755 --- a/src/backend/people/settings.py +++ b/src/backend/people/settings.py @@ -1,5 +1,5 @@ """ -Django settings for People project. +Django's settings for People project. Generated by 'django-admin startproject' using Django 3.1.5. @@ -182,7 +182,7 @@ class Base(Configuration): "django.contrib.auth.backends.ModelBackend", ] - # Django applications from the highest priority to the lowest + # Django's applications from the highest priority to the lowest INSTALLED_APPS = [ # People "core",