mirror of
https://framagit.org/la-chariotte/la-chariotte.git
synced 2025-05-17 03:01:49 +02:00
Compare commits
2 commits
4e7602f30b
...
af08684e35
Author | SHA1 | Date | |
---|---|---|---|
![]() |
af08684e35 | ||
![]() |
96a0404d80 |
3 changed files with 14 additions and 47 deletions
|
@ -26,7 +26,7 @@
|
|||
{% for place in context.places %}
|
||||
<tr>
|
||||
<td>
|
||||
<a title="Détail du lieu de distribution" href="{% url 'order:place_overview' place.code %}">{{ place }}</a> (<a href="{% url 'order:place_update' place.code %}">modifier</a>)
|
||||
<a title="Détail du lieu de distribution" href="{% url 'order:place_update' place.code %}">{{ place }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{% if place.code in context.orders.keys %}
|
||||
|
|
|
@ -35,11 +35,13 @@
|
|||
<i class="fa fa-calendar" aria-hidden="true"></i> <i>Fin des commandes</i> le {{ order.deadline }}
|
||||
<br><i class="fa fa-truck" aria-hidden="true"></i> <i>Livraison</i> le {{ order.delivery_date }}
|
||||
{% if order.places.all|length > 1 %}
|
||||
{#{% counter = order.places.all|length - 1 %}#}
|
||||
<br><i class="fa fa-building" aria-hidden="true"></i> <i>Autres lieux de livraison:</i>
|
||||
{% for other_place in order.places.all %}
|
||||
{#{% set counter = counter - 1 %}#}
|
||||
{% if other_place.code != place.code %}
|
||||
<a href="{% url 'order:place_overview' other_place.code %}">{{ other_place.name }}</a>
|
||||
{% if forloop.counter0|add:"2" < order.places.all|length %}, {% endif %}
|
||||
{% if counter > 0 %}, {% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
|
@ -294,19 +294,6 @@ class TestPlaceIndexView:
|
|||
|
||||
body = response.content.decode()
|
||||
|
||||
place1_overview_view_url = reverse(
|
||||
"order:place_overview",
|
||||
kwargs={
|
||||
"code": place1.code,
|
||||
},
|
||||
)
|
||||
place2_overview_view_url = reverse(
|
||||
"order:place_overview",
|
||||
kwargs={
|
||||
"code": place2.code,
|
||||
},
|
||||
)
|
||||
|
||||
place1_update_view_url = reverse(
|
||||
"order:place_update",
|
||||
kwargs={
|
||||
|
@ -321,12 +308,12 @@ class TestPlaceIndexView:
|
|||
)
|
||||
|
||||
place1_body_expected = (
|
||||
'<a title="Détail du lieu de distribution" href="%s">%s</a> (<a href="%s">modifier</a>)'
|
||||
% (place1_overview_view_url, place1.name, place1_update_view_url)
|
||||
'<a title="Détail du lieu de distribution" href="%s">%s</a>'
|
||||
% (place1_update_view_url, place1.name)
|
||||
)
|
||||
place2_body_expected = (
|
||||
'<a title="Détail du lieu de distribution" href="%s">%s</a> (<a href="%s">modifier</a>)'
|
||||
% (place2_overview_view_url, place2.name, place2_update_view_url)
|
||||
'<a title="Détail du lieu de distribution" href="%s">%s</a>'
|
||||
% (place2_update_view_url, place2.name)
|
||||
)
|
||||
assert place1_body_expected in body
|
||||
assert place2_body_expected in body
|
||||
|
@ -361,19 +348,6 @@ class TestPlaceIndexView:
|
|||
# Strip whitespace so we can examine the HTML without parsing it
|
||||
stripped_body = re.sub(r"\s\s+", " ", response.content.decode())
|
||||
|
||||
place1_overview_view_url = reverse(
|
||||
"order:place_overview",
|
||||
kwargs={
|
||||
"code": place1.code,
|
||||
},
|
||||
)
|
||||
place2_overview_view_url = reverse(
|
||||
"order:place_overview",
|
||||
kwargs={
|
||||
"code": place2.code,
|
||||
},
|
||||
)
|
||||
|
||||
place1_update_view_url = reverse(
|
||||
"order:place_update",
|
||||
kwargs={
|
||||
|
@ -401,18 +375,17 @@ class TestPlaceIndexView:
|
|||
)
|
||||
|
||||
place1_body_expected = (
|
||||
'<td> <a title="Détail du lieu de distribution" href="%s">%s</a> (<a href="%s">modifier</a>) </td> <td> <a href="%s">%s</a><br> </td>'
|
||||
'<td> <a title="Détail du lieu de distribution" href="%s">%s</a> </td> <td> <a href="%s">%s</a><br> </td>'
|
||||
% (
|
||||
place1_overview_view_url,
|
||||
place1.name,
|
||||
place1_update_view_url,
|
||||
place1.name,
|
||||
grouped_order1_detail_view_url,
|
||||
grouped_order1.name,
|
||||
)
|
||||
)
|
||||
place2_body_expected = (
|
||||
'<td> <a title="Détail du lieu de distribution" href="%s">%s</a> (<a href="%s">modifier</a>) </td> <td> Aucune </td> '
|
||||
% (place2_overview_view_url, place2.name, place2_update_view_url)
|
||||
'<td> <a title="Détail du lieu de distribution" href="%s">%s</a> </td> <td> Aucune </td> '
|
||||
% (place2_update_view_url, place2.name)
|
||||
)
|
||||
assert place1_body_expected in stripped_body
|
||||
assert place2_body_expected in stripped_body
|
||||
|
@ -453,13 +426,6 @@ class TestPlaceIndexView:
|
|||
},
|
||||
)
|
||||
|
||||
place_overview_view_url = reverse(
|
||||
"order:place_overview",
|
||||
kwargs={
|
||||
"code": place.code,
|
||||
},
|
||||
)
|
||||
|
||||
grouped_order1_detail_view_url = reverse(
|
||||
"order:grouped_order_detail",
|
||||
kwargs={
|
||||
|
@ -474,11 +440,10 @@ class TestPlaceIndexView:
|
|||
)
|
||||
|
||||
place_body_expected = (
|
||||
'<td> <a title="Détail du lieu de distribution" href="%s">%s</a> (<a href="%s">modifier</a>) </td> <td> <a href="%s">%s</a><br> <a href="%s">%s</a><br> </td>'
|
||||
'<td> <a title="Détail du lieu de distribution" href="%s">%s</a> </td> <td> <a href="%s">%s</a><br> <a href="%s">%s</a><br> </td>'
|
||||
% (
|
||||
place_overview_view_url,
|
||||
place.name,
|
||||
place_update_view_url,
|
||||
place.name,
|
||||
grouped_order2_detail_view_url,
|
||||
grouped_order2.name,
|
||||
grouped_order1_detail_view_url,
|
||||
|
|
Loading…
Reference in a new issue