Refactored and added pytest.ini file

This commit is contained in:
Thu Trang Pham
2020-11-01 07:30:51 -08:00
parent 3c47e66ca1
commit a63d4292b1
9 changed files with 74 additions and 33 deletions
@@ -19,17 +19,35 @@
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object_id|admin_urlquote %}">{{ object_name|truncatewords:"18" }}</a>
&rsaquo; {% trans 'Change Confirmation' %}
{% if not add %}
&rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
&rsaquo; <a href="{% url opts|admin_urlname:'change' object_id|admin_urlquote %}">{{ object_name|truncatewords:"18" }}</a>
&rsaquo; {% trans 'Confirm change' %}
{% else %}
&rsaquo; {% trans 'Confirm add' %}
{% endif %}
</div>
{% endblock %}
{% block content %}
{% if add %}
<p>{% blocktrans with escaped_object=object %}Are you sure you want to add the {{ model_name }}?{% endblocktrans %}</p>
{% if changed_data %}
<div class="changed-data">
<p><b>Confirm Values:</b></p>
<table>
{% for field, values in changed_data.items %}
<tr><th style="text-align: right">{{ field }}:</th><td>{{ values.1 }}</td></tr>
{% endfor %}
</table>
</div>
<form method="post" action="{% url opts|admin_urlname:'add'%}">{% csrf_token %}
{% endif %}
{% else %}
<p>{% blocktrans with escaped_object=object %}Are you sure you want to change the {{ model_name }} "{{ object_name }}"?{% endblocktrans %}</p>
{% if changed_data %}
<div class="changed-data">
<p><b>Detected Changes:</b></p>
<p><b>Confirm Values:</b></p>
<table>
<tr><th>Field</th><th>Current Value</th><th>New Value</th></tr>
{% for field, values in changed_data.items %}
@@ -39,6 +57,7 @@
</div>
{% endif %}
<form method="post" action="{% url opts|admin_urlname:'change' object_id|admin_urlquote %}">{% csrf_token %}
{% endif %}
<div>
{% for key, value in form_data.items %}
<input type="hidden" name="{{ key }}" value="{{ value }}">