✏️(project) fix minor typos

Found typos, fixed them.
This commit is contained in:
Lebaud Antoine
2024-02-15 20:26:19 +01:00
committed by aleb_the_flash
parent 1f1253ab21
commit 469903c9eb
8 changed files with 23 additions and 23 deletions

View File

@@ -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/).

View File

@@ -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)

View File

@@ -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

View File

@@ -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:

View File

@@ -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é"

View File

@@ -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:

View File

@@ -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

View File

@@ -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",