Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 6, 2024
1 parent 3599f65 commit b2cae16
Show file tree
Hide file tree
Showing 31 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,4 @@ def setup(app):

# -- Linkcheck configuration -----------------------------------------------

linkcheck_ignore = [re.compile(r'https://djangopackages\.org/.*')]
linkcheck_ignore = [re.compile(r"https://djangopackages\.org/.*")]
1 change: 1 addition & 0 deletions example_extension_project/config/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Extension project URL Configuration"""

from django.contrib import admin

try:
Expand Down
1 change: 1 addition & 0 deletions example_extension_project/user_extension/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Demonstrate use of UserAdmin on extended User model"""

from django.contrib import admin
from django.contrib.auth import get_user_model

Expand Down
1 change: 1 addition & 0 deletions example_extension_project/user_extension/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Application Definition File"""

from django.apps import AppConfig


Expand Down
1 change: 1 addition & 0 deletions example_extension_project/user_extension/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Demonstrated here to ensure that Improved User Factory can be subclassed.
"""

from factory import Faker

from improved_user.factories import UserFactory as BaseUserFactory
Expand Down
1 change: 1 addition & 0 deletions example_extension_project/user_extension/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Demonstration of how to extend the Improved User model"""

from django.db import models
from django.utils.translation import gettext_lazy as _

Expand Down
1 change: 1 addition & 0 deletions example_extension_project/user_extension/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests to ensure proper subclassing of models, forms, and factories"""

from unittest.mock import patch

from django.contrib.auth import get_user_model
Expand Down
1 change: 1 addition & 0 deletions example_integration_project/config/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Integration project URL Configuration"""

from django.contrib import admin
from django.urls import re_path
from django.views.generic import TemplateView
Expand Down
1 change: 1 addition & 0 deletions example_integration_project/user_integration/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Application Definition File"""

from django.apps import AppConfig


Expand Down
1 change: 1 addition & 0 deletions example_integration_project/user_integration/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This test suite is legacy, and will be replaced in the near future.
"""

from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
Expand Down
1 change: 1 addition & 0 deletions example_replacement_project/config/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Replacement project URL Configuration"""

from django.contrib import admin

try:
Expand Down
1 change: 1 addition & 0 deletions example_replacement_project/user_replacement/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Application Definition File"""

from django.apps import AppConfig


Expand Down
1 change: 1 addition & 0 deletions example_replacement_project/user_replacement/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A User model created by django-improved-user mixins"""

from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.utils.translation import gettext_lazy as _

Expand Down
1 change: 1 addition & 0 deletions example_replacement_project/user_replacement/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the extended User model"""

from types import MethodType

from django.test import TestCase
Expand Down
1 change: 1 addition & 0 deletions src/improved_user/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compose new Django User models that follow best-practices for international names and authenticate via email instead of username."""

# This file:
# 1. define directory as module
# 2. set default app config
Expand Down
1 change: 1 addition & 0 deletions src/improved_user/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Admin Configuration for Improved User"""

from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext_lazy as _

Expand Down
1 change: 1 addition & 0 deletions src/improved_user/apps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""App Configuration for Improved User"""

from django.apps import AppConfig
from django.contrib import admin
from django.contrib.auth import get_user_model
Expand Down
1 change: 1 addition & 0 deletions src/improved_user/factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Factories to make testing with Improved User easier"""

from django.contrib.auth import get_user_model

try:
Expand Down
1 change: 1 addition & 0 deletions src/improved_user/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Forms for Creating and Updating Improved Users"""

from django import forms
from django.contrib.auth import get_user_model, password_validation
from django.contrib.auth.forms import ReadOnlyPasswordHashField
Expand Down
1 change: 1 addition & 0 deletions src/improved_user/managers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""User Manager used by Improved User; may be extended"""

from django.contrib.auth.models import BaseUserManager


Expand Down
1 change: 1 addition & 0 deletions src/improved_user/model_mixins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mix-in Classes intended for use with Django Models"""

from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.core.mail import send_mail
from django.db import models
Expand Down
1 change: 1 addition & 0 deletions src/improved_user/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The UserManager is found in managers.py
"""

from .model_mixins import AbstractUser


Expand Down
1 change: 1 addition & 0 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Admin interface provided by Improved User"""

import os
import re

Expand Down
1 change: 1 addition & 0 deletions tests/test_auth_backends.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Improved User against Django's default backend"""

# pylint: disable=protected-access
from unittest.mock import patch

Expand Down
1 change: 1 addition & 0 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test basic functionality; test API used by a Django project developer"""

from django.contrib.auth import get_user, get_user_model
from django.http import HttpRequest
from django.test import TestCase
Expand Down
1 change: 1 addition & 0 deletions tests/test_factories.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test model factories provided by Improved User"""

from django.test import TestCase

from improved_user.factories import UserFactory
Expand Down
7 changes: 4 additions & 3 deletions tests/test_forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test UserCreationForm and UserChangeForm"""

from unittest.mock import patch

from django import VERSION as DJANGO_VERSION
Expand Down Expand Up @@ -269,9 +270,9 @@ class MyUserForm(UserChangeForm):

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields[
"groups"
].help_text = "These groups give users different permissions"
self.fields["groups"].help_text = (
"These groups give users different permissions"
)

class Meta(UserChangeForm.Meta):
fields = ("groups",)
Expand Down
1 change: 1 addition & 0 deletions tests/test_management.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test User model management commands"""

import builtins
from io import StringIO

Expand Down
1 change: 1 addition & 0 deletions tests/test_managers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test User model manager"""

from datetime import datetime

from django.test import TestCase
Expand Down
1 change: 1 addition & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Improved User Model"""

from datetime import datetime
from types import MethodType
from unittest.mock import patch
Expand Down
1 change: 1 addition & 0 deletions tests/test_signals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test Signal Handling"""

from django.db.models.signals import post_save
from django.test import TestCase

Expand Down

0 comments on commit b2cae16

Please sign in to comment.