mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-09-21 19:32:34 +03:00
Adapts project version
This commit is contained in:
parent
16d4de5ccc
commit
13003f0ccb
|
@ -32,7 +32,7 @@ TEMPLATES[0]["OPTIONS"]["debug"] = True # type: ignore # noqa: F405
|
|||
# MEDIA
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#media-url
|
||||
MEDIA_URL = 'http://media.testserver'
|
||||
MEDIA_URL = "http://media.testserver"
|
||||
|
||||
{%- if cookiecutter.frontend_pipeline == 'Webpack' %}
|
||||
# django-webpack-loader
|
||||
|
|
|
@ -52,4 +52,4 @@ django-webpack-loader==2.0.1 # https://github.com/django-webpack/django-webpack
|
|||
# Project
|
||||
# ------------------------------------------------------------------------------
|
||||
fontawesomefree==6.4.2 # https://github.com/FortAwesome/Font-Awesome
|
||||
django-import-export==3.2.0 # https://github.com/django-import-export/django-import-export
|
||||
django-import-export==3.3.1 # https://github.com/django-import-export/django-import-export
|
||||
|
|
|
@ -25,7 +25,7 @@ djangorestframework-stubs[compatible-mypy]==3.14.3 # https://github.com/typeddj
|
|||
# ------------------------------------------------------------------------------
|
||||
sphinx==7.2.6 # https://github.com/sphinx-doc/sphinx
|
||||
sphinx-autobuild==2021.3.14 # https://github.com/GaretJax/sphinx-autobuild
|
||||
sphinx-rtd-theme==1.2.0 # https://pypi.org/project/sphinx-rtd-theme/
|
||||
sphinx-rtd-theme==1.3.0 # https://pypi.org/project/sphinx-rtd-theme/
|
||||
|
||||
# Code quality
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -136,7 +136,7 @@
|
|||
{% if request.user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link"
|
||||
href="{% endraw %}{% raw %}{% url 'users:detail' request.user.pk %}{% endraw %}{% raw %}">{% translate "My Profile" %}</a>
|
||||
href="{% endraw %}{% raw %}{% url 'users:detail' request.user.uuid %}{% endraw %}{% raw %}">{% translate "My Profile" %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
{# URL provided by django-allauth/account/urls.py #}
|
||||
|
|
|
@ -2,19 +2,22 @@
|
|||
|
||||
{% load static %}
|
||||
|
||||
{% block title %}User: {{ object }}{% endblock title %}
|
||||
|
||||
{% block title %}
|
||||
User: {% endraw %}
|
||||
{% raw %}{{ object.first_name }}{% endraw %}
|
||||
{% raw %}
|
||||
{% endblock title %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
|
||||
<h2>{{ object }}</h2>
|
||||
<p>{{ object.first_name }}</p>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h2>
|
||||
{% endraw %}
|
||||
{% raw %}{{ object.first_name }}{% endraw %}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
{%- raw %}
|
||||
{% raw %}
|
||||
{% if object == request.user %}
|
||||
<!-- Action buttons -->
|
||||
<div class="row">
|
||||
|
@ -30,4 +33,4 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
{%- endraw %}
|
||||
{% endraw %}
|
||||
|
|
|
@ -22,6 +22,8 @@ class TestUserAdmin:
|
|||
response = admin_client.post(
|
||||
url,
|
||||
data={
|
||||
"first_name": "New",
|
||||
"last_name": "Admin",
|
||||
"email": "new-admin@example.com",
|
||||
"password1": "My_R@ndom-P@ssw0rd",
|
||||
"password2": "My_R@ndom-P@ssw0rd",
|
||||
|
|
|
@ -29,7 +29,9 @@ class TestUserViewSet:
|
|||
response = view.me(request) # type: ignore
|
||||
|
||||
assert response.data == {
|
||||
"email": user.uuid,
|
||||
"email": user.email,
|
||||
"uuid": str(user.uuid),
|
||||
"first_name": user.first_name,
|
||||
"last_name": user.last_name,
|
||||
"url": f"http://testserver/api/users/{user.uuid}/",
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@ from {{ cookiecutter.project_slug }}.users.models import User
|
|||
class TestUserManager:
|
||||
def test_create_user(self):
|
||||
user = User.objects.create_user(
|
||||
first_name="John",
|
||||
last_name="Doe",
|
||||
email="john@example.com",
|
||||
password="something-r@nd0m!",
|
||||
)
|
||||
|
@ -21,6 +23,8 @@ class TestUserManager:
|
|||
|
||||
def test_create_superuser(self):
|
||||
user = User.objects.create_superuser(
|
||||
first_name="Admin",
|
||||
last_name="User",
|
||||
email="admin@example.com",
|
||||
password="something-r@nd0m!",
|
||||
)
|
||||
|
@ -31,6 +35,8 @@ class TestUserManager:
|
|||
|
||||
def test_create_superuser_username_ignored(self):
|
||||
user = User.objects.create_superuser(
|
||||
first_name="Test",
|
||||
last_name="User",
|
||||
email="test@example.com",
|
||||
password="something-r@nd0m!",
|
||||
)
|
||||
|
@ -45,6 +51,10 @@ def test_createsuperuser_command():
|
|||
"createsuperuser",
|
||||
"--email",
|
||||
"henry@example.com",
|
||||
"--first_name",
|
||||
"Henry",
|
||||
"--last_name",
|
||||
"Ford",
|
||||
interactive=False,
|
||||
stdout=out,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user