Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix tests on Python 3.5

Pacu217f9dd39a82c
diff --git a/saleor/shipping/models.py b/saleor/shipping/models.py
index 5476efd373..4e6c65955e 100644
--- a/saleor/shipping/models.py
+++ b/saleor/shipping/models.py
@@ -25,7 +25,7 @@ class ShippingZone(models.Model):
def __str__(self):
return self.name
- def get_countries_display(self):
+ def countries_display(self):
if len(self.countries) <= 3:
return ', '.join((country.name for country in self.countries))
return pgettext_lazy(
diff --git a/templates/dashboard/shipping/detail.html b/templates/dashboard/shipping/detail.html
index 3d85492262..f22c75c26a 100644
--- a/templates/dashboard/shipping/detail.html
+++ b/templates/dashboard/shipping/detail.html
@@ -36,7 +36,7 @@
<div class="card">
<div class="card-content">
<span class="card-title">
- {% blocktrans with shipping_name=shipping_zone.name list_of_countries=shipping_zone.get_countries_display %}
+ {% blocktrans with shipping_name=shipping_zone.name list_of_countries=shipping_zone.countries_display %}
{{ shipping_name }} <small>(ships to {{ list_of_countries }})</small>
{% endblocktrans %}
</span>
diff --git a/templates/dashboard/shipping/list.html b/templates/dashboard/shipping/list.html
index 6fdb206b6d..ba9a754de6 100644
--- a/templates/dashboard/shipping/list.html
+++ b/templates/dashboard/shipping/list.html
@@ -24,7 +24,7 @@
{% block header_extra %}
<div class="btn-fab-fixed">
- <a href="{% url 'dashboard:shipping-zone-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add method" context "Shipping zone list add button text" %}">
+ <a href="{% url 'dashboard:shipping-zone-add' %}" class="btn-fab-default waves-effect waves-light" title="{% trans "Add shipping zone" context "Shipping zone list add button text" %}">
<svg data-src="{% static "dashboard/images/add.svg" %}" />
</a>
</div>
@@ -51,20 +51,20 @@
</tr>
</thead>
<tbody>
- {% for method in shipping_zones %}
- <tr data-action-go="{% url 'dashboard:shipping-zone-details' pk=method.pk %}">
+ {% for shipping_zone in shipping_zones %}
+ <tr data-action-go="{% url 'dashboard:shipping-zone-details' pk=shipping_zone.pk %}">
<td>
- {{ method }}
+ {{ shipping_zone }}
</td>
<td>
- {% if not method.price_range %}
+ {% if not shipping_zone.price_range %}
-
{% else %}
- {% price method.price_range %}
+ {% price shipping_zone.price_range %}
{% endif %}
</td>
<td>
- {{ method.get_countries_display }}
+ {{ shipping_zone.countries_display }}
</td>
</tr>
{% endfor %}