Fix more empty lines issues

This commit is contained in:
Bruno Alla 2023-04-04 22:55:34 +01:00
parent 933d228607
commit f6372c3ec2
No known key found for this signature in database
2 changed files with 6 additions and 7 deletions

View File

@ -1,14 +1,16 @@
{%- if cookiecutter.username_type == "email" %}
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import AbstractUser, UserManager as DjangoUserManager
{%- else %}
{%- endif -%}
from django.contrib.auth.models import AbstractUser
{%- if cookiecutter.username_type == "email" %}
from django.contrib.auth.models import UserManager as DjangoUserManager
{%- endif %}
from django.db.models import CharField{% if cookiecutter.username_type == "email" %}, EmailField{% endif %}
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
{%- if cookiecutter.username_type == "email" %}
class UserManager(DjangoUserManager):
def _create_user(self, email, password, **extra_fields):
"""

View File

@ -5,10 +5,7 @@ from {{ cookiecutter.project_slug }}.users.models import User
def test_detail(user: User):
{%- if cookiecutter.username_type == "email" %}
assert (
reverse("users:detail", kwargs={"pk": user.pk})
== f"/users/{user.pk}/"
)
assert reverse("users:detail", kwargs={"pk": user.pk}) == f"/users/{user.pk}/"
assert resolve(f"/users/{user.pk}/").view_name == "users:detail"
{%- else %}
assert (