Merge pull request 'feature/translations' (#15) from feature/translations into main
ci/woodpecker/push/build Pipeline was successful Szczegóły

Reviewed-on: #15
feature/updated_django_wagtail
mtyton 2023-10-04 20:00:58 +00:00
commit 9bc46af370
19 zmienionych plików z 299 dodań i 62 usunięć

Wyświetl plik

@ -13,7 +13,8 @@ steps:
image: docker:24.0.6
secrets: []
commands:
- docker compose -f artel/docker-compose-test.yml run --rm test_comfy
- docker compose -f artel/docker-compose-test.yml run test_comfy
- docker compose -f ./artel/docker-compose-test.yml down
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:

Wyświetl plik

@ -28,6 +28,9 @@ RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-r
# Install the application server.
RUN pip install "gunicorn==20.0.4"
# Install gettext
RUN apt-get update && apt-get install -y gettext
# Install the project requirements.
COPY requirements.txt /
RUN pip install -r /requirements.txt

Wyświetl plik

@ -21,7 +21,10 @@ RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-r
libwebp-dev \
wkhtmltopdf \
&& rm -rf /var/lib/apt/lists/*
# Install gettext
RUN apt-get update && apt-get install -y gettext
# Install the project requirements.
COPY requirements.txt /
COPY requirements_dev.txt /

Wyświetl plik

@ -43,8 +43,11 @@ INSTALLED_APPS = [
"blog",
"search",
"setup",
"wagtail_localize",
"wagtail_localize.locales",
"wagtail.contrib.forms",
"wagtail.contrib.redirects",
"wagtail.contrib.simple_translation",
"wagtail.embeds",
"wagtail.sites",
"wagtail.users",
@ -82,7 +85,8 @@ MIDDLEWARE = [
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django.middleware.security.SecurityMiddleware",
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
'django.middleware.locale.LocaleMiddleware',
"wagtail.contrib.redirects.middleware.RedirectMiddleware"
]
ROOT_URLCONF = "artel.urls"
@ -99,6 +103,7 @@ TEMPLATES = [
'setup.context_processors.config_context_processor',
"django.template.context_processors.debug",
"django.template.context_processors.request",
'django.template.context_processors.i18n',
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
'wagtailmenus.context_processors.wagtailmenus',
@ -153,6 +158,16 @@ USE_L10N = True
USE_TZ = True
WAGTAIL_I18N_ENABLED = True
WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [
('en', "English"),
('pl', "Polish"),
]
LOCALE_PATHS = [
os.path.join(BASE_DIR, 'locale'),
]
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/

Wyświetl plik

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-globe" viewBox="0 0 16 16">
<path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm7.5-6.923c-.67.204-1.335.82-1.887 1.855A7.97 7.97 0 0 0 5.145 4H7.5V1.077zM4.09 4a9.267 9.267 0 0 1 .64-1.539 6.7 6.7 0 0 1 .597-.933A7.025 7.025 0 0 0 2.255 4H4.09zm-.582 3.5c.03-.877.138-1.718.312-2.5H1.674a6.958 6.958 0 0 0-.656 2.5h2.49zM4.847 5a12.5 12.5 0 0 0-.338 2.5H7.5V5H4.847zM8.5 5v2.5h2.99a12.495 12.495 0 0 0-.337-2.5H8.5zM4.51 8.5a12.5 12.5 0 0 0 .337 2.5H7.5V8.5H4.51zm3.99 0V11h2.653c.187-.765.306-1.608.338-2.5H8.5zM5.145 12c.138.386.295.744.468 1.068.552 1.035 1.218 1.65 1.887 1.855V12H5.145zm.182 2.472a6.696 6.696 0 0 1-.597-.933A9.268 9.268 0 0 1 4.09 12H2.255a7.024 7.024 0 0 0 3.072 2.472zM3.82 11a13.652 13.652 0 0 1-.312-2.5h-2.49c.062.89.291 1.733.656 2.5H3.82zm6.853 3.472A7.024 7.024 0 0 0 13.745 12H11.91a9.27 9.27 0 0 1-.64 1.539 6.688 6.688 0 0 1-.597.933zM8.5 12v2.923c.67-.204 1.335-.82 1.887-1.855.173-.324.33-.682.468-1.068H8.5zm3.68-1h2.146c.365-.767.594-1.61.656-2.5h-2.49a13.65 13.65 0 0 1-.312 2.5zm2.802-3.5a6.959 6.959 0 0 0-.656-2.5H12.18c.174.782.282 1.623.312 2.5h2.49zM11.27 2.461c.247.464.462.98.64 1.539h1.835a7.024 7.024 0 0 0-3.072-2.472c.218.284.418.598.597.933zM10.855 4a7.966 7.966 0 0 0-.468-1.068C9.835 1.897 9.17 1.282 8.5 1.077V4h2.355z"/>
</svg>

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.3 KiB

Wyświetl plik

@ -1,5 +1,6 @@
{% load static wagtailcore_tags wagtailuserbar %}
{% load menu_tags %}
{% load i18n %}
<!DOCTYPE html>
<html lang="en">
@ -38,14 +39,14 @@
<div class="container">
<div class="row">
{% if navbar_position == 'top' %}
<div class="col-md-12 mt-5 ml-2">
{% main_menu max_levels=3 template="menu/custom_main_menu.html" %}
<div class="col-md-12 mt-5 ml-2">
{% main_menu max_levels=3 template="menu/custom_main_menu.html" %}
</div>
{% endif %}
{% if navbar_position == 'left' %}
<div class="col-md-3 mt-5 ml-2">
{% main_menu max_levels=3 template="menu/custom_main_menu.html" %}
{% main_menu max_levels=3 template="menu/custom_main_menu.html" %}
</div>
{% endif %}
<div class="col-md-9 mt-5 ml-2">
@ -58,10 +59,31 @@
</div>
{% if navbar_position == 'right' %}
<div class="col-md-3 mt-5 ml-2">
{% main_menu max_levels=3 template="menu/custom_main_menu.html" %}
{% main_menu max_levels=3 template="menu/custom_main_menu.html" %}
</div>
{% endif %}
</div>
<div class="row">
<div class="col-md-11 mt-5 ml-2"></div>
<div class="col-md-1 mt-5 ml-2">
{% if page %}
<div class="dropdown">
<button class="btn btn-outline-secondary btn-lg" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="{% static 'images/icons/globe.svg' %}">
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
{% for translation in page.get_translations.live %}
<a class="dropdown-item text-center" href="{% pageurl translation %}"" rel="alternate" hreflang="{{ translation.locale.language_code }}">
{{translation.locale.language_code | language_name}}
</a>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</div>
</div>
{# Global javascript #}

Wyświetl plik

@ -1,11 +1,14 @@
{% load static %}
{% load menu_tags %}
{% load wagtailcore_tags %}
{% load i18n %}
<div class="d-flex flex-column flex-shrink-0 p-3 mr-5">
<img src="{{logo}}" class="img-fluid rounded mx-auto d-block mt-3" style="width: 10rem; height: 10 rem;" alt="Portal Logo"/>
<hr>
<ul class="nav navbar-nav">
{% for item in menu_items %}
<li class="{{ item.active_class }}">
<a href="{{ item.href }}">{{ item.text }}</a>
@ -23,6 +26,6 @@
<div class="d-flex flex-column flex-shrink-0 p-3 mr-5">
<hr>
{% if shop_enabled %}
<a href={% url 'cart' %} alt="Koszyk" > Koszyk </a>
<a href={% url 'cart' %} alt="Koszyk" >{% trans "Cart" %}</a>
{% endif %}
</div>

Wyświetl plik

@ -10,6 +10,8 @@ from wagtail.admin import urls as wagtailadmin_urls
from wagtail import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
from django.conf.urls.i18n import i18n_patterns
from search import views as search_views
from setup import views as setup_views
@ -21,12 +23,10 @@ urlpatterns = [
path("django-admin/", admin.site.urls),
path("admin/", include(wagtailadmin_urls)),
path("documents/", include(wagtaildocs_urls)),
path("search/", search_views.search, name="search"),
path('store-app/', include('store.urls')),
path('setup/', include('setup.urls')),
]
if settings.DEBUG:
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
@ -36,12 +36,7 @@ if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)
urlpatterns = urlpatterns + [
# For anything not caught by a more specific rule above, hand over to
# Wagtail's page serving mechanism. This should be the last pattern in
# the list:
urlpatterns = urlpatterns + i18n_patterns(
path('search/', search_views.search, name='search'),
path("", include(wagtail_urls)),
# Alternatively, if you want Wagtail pages to be served from a subpath
# of your site, rather than the site root:
# path("pages/", include(wagtail_urls)),
]
)

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -0,0 +1,189 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-06-20 13:43+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n"
"%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n"
"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
#: artel/templates/menu/custom_main_menu.html:33
msgid "Cart"
msgstr "Koszyk"
#: home/templates/home/welcome_page.html:6
msgid "Visit the Wagtail website"
msgstr ""
#: home/templates/home/welcome_page.html:15
msgid "View the release notes"
msgstr ""
#: home/templates/home/welcome_page.html:27
msgid "Welcome to your new Wagtail site!"
msgstr ""
#: home/templates/home/welcome_page.html:28
msgid ""
"Please feel free to <a href=\"https://github.com/wagtail/wagtail/wiki/Slack"
"\">join our community on Slack</a>, or get started with one of the links "
"below."
msgstr ""
#: home/templates/home/welcome_page.html:35
msgid "Wagtail Documentation"
msgstr ""
#: home/templates/home/welcome_page.html:36
msgid "Topics, references, & how-tos"
msgstr ""
#: home/templates/home/welcome_page.html:42
msgid "Tutorial"
msgstr ""
#: home/templates/home/welcome_page.html:43
msgid "Build your first Wagtail site"
msgstr ""
#: home/templates/home/welcome_page.html:49
msgid "Admin Interface"
msgstr ""
#: home/templates/home/welcome_page.html:50
msgid "Create your superuser first!"
msgstr ""
#: search/templates/search/search.html:10
#: search/templates/search/search.html:14
msgid "Search"
msgstr "Wyszukaj"
#: search/templates/search/search.html:30
#: store/templates/store/product_list_page.html:39
msgid "Previous"
msgstr "Poprzednia"
#: search/templates/search/search.html:34
#: store/templates/store/product_list_page.html:45
msgid "Next"
msgstr "Następna"
#: search/templates/search/search.html:37
msgid "No results found"
msgstr "Nie znaleziono wyników"
#: store/forms.py:21
msgid "Name"
msgstr "Imię"
#: store/forms.py:25
msgid "Surname"
msgstr "Nazwisko"
#: store/forms.py:28 store/templates/store/order_confirm.html:42
msgid "Address"
msgstr "Adres"
#: store/forms.py:31
msgid "City"
msgstr "Miasto"
#: store/forms.py:34
msgid "Zip-code"
msgstr "Kod pocztowy"
#: store/forms.py:37
msgid "E-mail"
msgstr "Email"
#: store/forms.py:40
msgid "Phone number"
msgstr "Numer telefonu"
#: store/forms.py:43
msgid "Polska"
msgstr ""
#: store/forms.py:43
msgid "Country"
msgstr "Kraj"
#: store/templates/store/cart.html:9
msgid "Shopping Cart"
msgstr "Koszyk"
#: store/templates/store/cart.html:20
#: store/templates/store/order_confirm.html:66
msgid "To Pay:"
msgstr "Do zapłaty:"
#: store/templates/store/cart.html:23
msgid "Proceed to Pay"
msgstr "Przejdź do płatności"
#: store/templates/store/order.html:12
msgid "Order Data"
msgstr "Dane zamówienia"
#: store/templates/store/order.html:13
msgid "We won't share your data"
msgstr "Nie udostępnimy Twoich danych"
#: store/templates/store/order.html:58
msgid "Contact Details"
msgstr "Dane kontaktowe"
#: store/templates/store/order.html:88
#: store/templates/store/order_confirm.html:69
msgid "Confirm"
msgstr "Potwierdź"
#: store/templates/store/order_confirm.html:9
msgid "Customer Data"
msgstr "Dane klienta"
#: store/templates/store/order_confirm.html:15
msgid "Full Name"
msgstr "Pełne imię"
#: store/templates/store/order_confirm.html:24
msgid "Email"
msgstr "Email"
#: store/templates/store/order_confirm.html:33
msgid "Phone"
msgstr "Numer Telefonu"
#: store/templates/store/order_confirm.html:55
msgid "Order Items"
msgstr "Zamawiane przedmioty"
#: store/templates/store/product_list_page.html:10
msgid "Added to cart"
msgstr "Dodano do koszyka"
#: store/templates/store/product_list_page.html:16
msgid "Item has been added to cart."
msgstr "Przedmiot został dodany do koszyka"
#: store/templates/store/product_list_page.html:19
msgid "Continue shopping"
msgstr "Kontynuuj zakupy"
#: store/templates/store/product_list_page.html:20
msgid "Go to cart"
msgstr "Idź do koszyka"

Wyświetl plik

@ -15,3 +15,4 @@ easy_thumbnails==2.8.5
num2words==0.5.12
sentry-sdk==1.28.0
pandas==2.0.3
wagtail-localize==1.5.2

Wyświetl plik

@ -1,16 +1,17 @@
{% extends "base.html" %}
{% load static wagtailcore_tags %}
{% load i18n %}
{% block body_class %}template-searchresults{% endblock %}
{% block title %}Search{% endblock %}
{% block content %}
<h1>Search</h1>
<h1>{% trans "Search" %}</h1>
<form action="{% url 'search' %}" method="get">
<input type="text" name="query"{% if search_query %} value="{{ search_query }}"{% endif %}>
<input type="submit" value="Search" class="button">
<input type="submit" value=" {% trans "Search" %}" class="button">
</form>
{% if search_results %}
@ -26,13 +27,13 @@
</ul>
{% if search_results.has_previous %}
<a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.previous_page_number }}">Previous</a>
<a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.previous_page_number }}">{% trans "Previous" %}</a>
{% endif %}
{% if search_results.has_next %}
<a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.next_page_number }}">Next</a>
<a href="{% url 'search' %}?query={{ search_query|urlencode }}&amp;page={{ search_results.next_page_number }}">{% trans "Next" %}</a>
{% endif %}
{% elif search_query %}
No results found
{% trans "No results found" %}
{% endif %}
{% endblock %}

Wyświetl plik

@ -11,41 +11,42 @@ from store.models import (
DeliveryMethod
)
from django.utils.translation import gettext_lazy as _
class CustomerDataForm(forms.Form):
name = forms.CharField(
max_length=255, label="Imię", widget=forms.TextInput(attrs={"class": "form-control"})
max_length=255, label=_("Name"), widget=forms.TextInput(attrs={"class": "form-control"})
)
surname = forms.CharField(
max_length=255, label="Nazwisko", widget=forms.TextInput(attrs={"class": "form-control"})
max_length=255, label=_("Surname"), widget=forms.TextInput(attrs={"class": "form-control"})
)
street = forms.CharField(
max_length=255, label="Adres", widget=forms.TextInput(attrs={"class": "form-control"})
max_length=255, label=_("Address"), widget=forms.TextInput(attrs={"class": "form-control"})
)
city = forms.CharField(
max_length=255, label="Miasto", widget=forms.TextInput(attrs={"class": "form-control"})
max_length=255, label=_("City"), widget=forms.TextInput(attrs={"class": "form-control"})
)
zip_code = forms.CharField(
max_length=255, label="Kod pocztowy", widget=forms.TextInput(attrs={"class": "form-control"})
max_length=255, label=_("Zip-code"), widget=forms.TextInput(attrs={"class": "form-control"})
)
email = forms.EmailField(
max_length=255, label="E-mail", widget=forms.EmailInput(attrs={"class": "form-control"})
max_length=255, label=_("E-mail"), widget=forms.EmailInput(attrs={"class": "form-control"})
)
phone = PhoneNumberField(
region="PL", label="Numer telefonu", widget=forms.TextInput(attrs={"class": "form-control"})
region="PL", label=_("Phone number"), widget=forms.TextInput(attrs={"class": "form-control"})
)
country = forms.ChoiceField(
choices=(("PL", "Polska"), ), label="Kraj",
choices=(("PL", _("Polska")), ), label=_("Country"),
widget=forms.Select(attrs={"class": "form-control"})
)
payment_method = forms.ModelChoiceField(
queryset=PaymentMethod.objects.filter(active=True), label="Sposób płatności",
widget=forms.Select(attrs={"class": "form-control"})
)
delivery_method = forms.ModelChoiceField(
queryset=DeliveryMethod.objects.filter(active=True), label="Sposób dostawy",
widget=forms.Select(attrs={"class": "form-control"})

Wyświetl plik

@ -1,12 +1,12 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% block content %}
<section class="h-100">
<div class="container h-100 py-5">
<div class="row d-flex justify-content-center align-items-center">
<div class="d-flex justify-content-between align-items-center mb-4">
<h3 class="fw-normal mb-0 text-black">Koszyk</h3>
<h3 class="fw-normal mb-0 text-black"> {% trans "Shopping Cart" %} </h3>
</div>
</div>
{% for group in cart.display_items %}
@ -22,16 +22,16 @@
<div class="card-body">
<div class="row">
<div class="col-sm-6">
<h5 class="fw-normal mb-0 text-black">W sumie do zapłaty: {{cart.total_price}}</h5>
<h5 class="fw-normal mb-0 text-black">{%trans "To Pay:"%} {{cart.total_price}}</h5>
</div>
<div class="col-sm-6 text-end">
<a href="{% url 'order' %}" class="btn btn-success btn-block btn-lg">Dalej</a>
<a href="{% url 'order' %}" class="btn btn-success btn-block btn-lg">{%trans "Proceed to Pay"%}</a>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}

Wyświetl plik

@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% block content %}
<form action="" method="POST">
@ -8,7 +9,8 @@
<div class="container pt-4">
<div class="row">
<div class="col-12 px-4">
<h2>Twoje dane</h2>
<h1>{% trans "Your Data" %}</h1>
<hr class="mt-1" />
</div>
<hr class="mt-2" />
</div>
@ -44,7 +46,7 @@
</div>
<div class="row mt-3">
<div class="col-12 px-4">
<h2>Dane do wysyłki</h2>
<h2>{% trans "Shipping Address"%}</h2>
</div>
<hr class="mt-2" />
</div>
@ -76,7 +78,7 @@
</div>
<div class="row mt-3">
<div class="col-12 px-4">
<h2>Płatność i wysyłka</h2>
<h2>{% trans "Payment and Shipping" %}</h2>
</div>
<hr class="mt-2" />
</div>
@ -99,7 +101,7 @@
<div class="row mt-3">
<div class="col-12 text-end mt-3">
<div class="form-outline">
<input type="submit" value="Dalej" class="btn btn-success btn-lg">
<input type="submit" value="{% trans "Confirm" %}" class="btn btn-success btn-lg">
</div>
</div>
</div>

Wyświetl plik

@ -1,17 +1,18 @@
{% extends 'base.html' %}
{% load static %}
{% load i18n %}
{% block content %}
<section class="h-100">
<div class="container">
<div class="d-flex justify-content-between align-items-center mb-4">
<h3 class="fw-normal mb-0 text-black">Twoje dane:</h3>
<h3 class="fw-normal mb-0 text-black">{% trans "Customer Data" %}</h3>
</div>
<div class="card mb-2 py-5">
<div class="card-body">
<div class="row">
<div class="col-sm-3">
<p class="mb-0">Imię i Nazwisko</p>
<p class="mb-0">{% trans "Full Name" %}</p>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">{{customer_data.name}} {{customer_data.surname}}</p>
@ -20,7 +21,7 @@
<hr>
<div class="row">
<div class="col-sm-3">
<p class="mb-0">Email</p>
<p class="mb-0">{% trans "Email" %}</p>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">{{customer_data.email}}</p>
@ -29,7 +30,7 @@
<hr>
<div class="row">
<div class="col-sm-3">
<p class="mb-0">Numer telefonu</p>
<p class="mb-0">{% trans "Phone" %}</p>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">{{customer_data.phone}}</p>
@ -38,7 +39,7 @@
<hr>
<div class="row">
<div class="col-sm-3">
<p class="mb-0">Adres</p>
<p class="mb-0">{% trans "Address" %}</p>
</div>
<div class="col-sm-9">
<p class="text-muted mb-0">
@ -54,7 +55,7 @@
<div class="container mt-5">
<div class="row d-flex justify-content-center align-items-center">
<div class="d-flex justify-content-between align-items-center mb-4">
<h3 class="fw-normal mb-0 text-black">Zamówione przedmioty</h3>
<h3 class="fw-normal mb-0 text-black">{% trans "Ordered Items" %}</h3>
</div>
</div>
{% for group in cart.display_items %}
@ -78,19 +79,16 @@
<div class="card-body">
<div class="row">
<div class="col-sm-6">
<h5 class="fw-normal mb-0 text-black">Do zapłaty: {{cart.total_price}} zł</h5>
<h5 class="fw-normal mb-0 text-black">{% trans "To Pay:"%} {{cart.total_price}}</h5>
</div>
<div class="col-sm-6 text-end">
<form action="" method="POST">
{% csrf_token %}
<input type="submit" class="btn btn-success btn-block btn-lg" value="Zamawiam">
</form>
<a href="" class="btn btn-success btn-block btn-lg">{% trans "Confirm"%}</a>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}

Wyświetl plik

@ -1,6 +1,6 @@
{% extends 'base.html'%}
{% load static %}
{% load static %}
{% load i18n %}
{% block content %}
<div class="container mb-3 mt-5">
@ -26,5 +26,5 @@
</li>
</ul>
</nav>
{% endblock %}

Wyświetl plik

@ -115,7 +115,7 @@ class SessionCartTestCase(BaseComfyTestCaseMixin, APITestCase):
def test_update_item_quantity_invalid_product_id(self):
response = self.client.put(
reverse("cart-action-update-product", kwargs={"pk": 2137}),
{"quantity": 5},
f'en/{reverse("cart-action-update-product", kwargs={"pk": 2137})}',
{"quantity": 5}
)
self.assertEqual(response.status_code, 404)

Wyświetl plik

@ -56,7 +56,7 @@ class ConfigureProductViewTestCase(BaseComfyTestCaseMixin, TestCase):
def test_get_failure_wrong_pk(self):
response = self.client.get(
reverse("product-configure", args=[12312]),
f'en/{reverse("product-configure", args=[12312])}',
)
self.assertEqual(response.status_code, 404)
@ -78,7 +78,7 @@ class ConfigureProductViewTestCase(BaseComfyTestCaseMixin, TestCase):
self.param2.key: [str(self.param2_value1.pk)]
}
response = self.client.post(
reverse("product-configure", args=[2137]),
f"en/{reverse('product-configure', args=[123123])}",
data=data
)
self.assertEqual(response.status_code, 404)