Skip to content

Commit

Permalink
fix html in edc-submit-line, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 14, 2025
1 parent 59fc3f4 commit 151d106
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions edc_model_admin/templates/edc_submit_line.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{% load i18n admin_urls %}
<div class="submit-row">
{% if show_save %}<input type="submit" value="{% translate 'Save' %}" class="default" name="_save" />{% endif %}
{% if show_save %}<input type="submit" value="{% translate 'Save' %}" class="default" name="_save">{% endif %}
{% if show_delete_link %}
{% url opts|admin_urlname:'delete' original.pk|admin_urlquote as delete_url %}
<p class="deletelink-box"><a href="{% add_preserved_filters delete_url %}" class="deletelink">{% translate "Delete" %}</a></p>
{% endif %}
{% if show_cancel %}
{% if show_save_next %}
<input type="submit" title="{% translate 'Leave form without saving' %}" value="{% translate 'Cancel' %}" name="_cancel" />
<input type="submit" title="{% translate 'Leave form without saving' %}" value="{% translate 'Cancel' %}" name="_cancel">
{% else %}
{% if cancel_url %}
<a href="{{ cancel_url }}" class="closelink" title="{% translate 'Leave form without saving' %}">{% translate 'Cancel' %}</a>
Expand All @@ -17,5 +17,5 @@
{% endif %}
{% endif %}
{% endif %}
{% if show_save and show_save_next %}<input type="submit" title="{% translate 'Save and go to next form in schedule' %}" value="{% translate 'Save and next' %}" name="_savenext" />{% endif %}
{% if show_save and show_save_next %}<input type="submit" title="{% translate 'Save and go to next form in schedule' %}" value="{% translate 'Save and next' %}" name="_savenext">{% endif %}
</div>
3 changes: 1 addition & 2 deletions edc_model_admin/tests/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<div class="container">
<div class="panel-group">
<div class="panel panel-success">
<div class="panel-headin
g"><h4>{% trans "You are at the subject dashboard" %}</h4></div>
<div class="panel-heading"><h4>{% trans "You are at the subject dashboard" %}</h4></div>
<div class="panel-body">{{subject_identifier}}</div>
</div>
</div>
Expand Down
3 changes: 3 additions & 0 deletions edc_model_admin/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"django_extensions",
"django_crypto_fields.apps.AppConfig",
"django_revision.apps.AppConfig",
"django_pylabels.apps.AppConfig",
"multisite",
"edc_pylabels.apps.AppConfig",
"edc_action_item.apps.AppConfig",
"edc_adverse_event.apps.AppConfig",
"edc_appointment.apps.AppConfig",
Expand All @@ -60,6 +62,7 @@
"edc_metadata.apps.AppConfig",
"edc_notification.apps.AppConfig",
"edc_offstudy.apps.AppConfig",
"edc_pharmacy.apps.AppConfig",
"edc_registration.apps.AppConfig",
"edc_review_dashboard.apps.AppConfig",
"edc_subject_dashboard.apps.AppConfig",
Expand Down
4 changes: 2 additions & 2 deletions edc_model_admin/tests/tests/test_model_admin_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.exceptions import ObjectDoesNotExist
from django.test import tag
from django.urls.base import reverse
from django_webtest import WebTest
from edc_appointment.models import Appointment
Expand Down Expand Up @@ -34,6 +33,7 @@

class ModelAdminSiteTest(WebTest):
lab_helper = SiteLabsTestHelper()
csrf_checks = False

@classmethod
def setUpTestData(cls):
Expand Down Expand Up @@ -126,6 +126,7 @@ def test_redirect_save_next_crf(self):

# oops, cancel
response = self.app.get(url, user=self.user)
self.assertIn("Add crf two", response)
form = get_webtest_form(response)
response = form.submit(name="_cancel").follow()
self.assertIn("You are at the subject dashboard", response)
Expand Down Expand Up @@ -402,7 +403,6 @@ def test_redirect_on_delete_with_url_name_is_none(self):
self.assertRaises(ObjectDoesNotExist, CrfSix.objects.get, id=crfsix.id)
self.assertIn("changelist", response)

@tag("1")
def test_add_directly_from_changelist_without_subject_visit_raises(self):
self.login()

Expand Down
2 changes: 2 additions & 0 deletions model_admin_app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"edc_protocol",
"edc_visit_schedule",
"edc_adverse_event",
"edc_pharmacy",
"edc_data_manager",
]:
for p in paths_for_urlpatterns(app_name):
urlpatterns.append(p)
Expand Down

0 comments on commit 151d106

Please sign in to comment.