From 11cd82337de7ff296d838a1485123d6f9b759836 Mon Sep 17 00:00:00 2001 From: Kaustubh Bhalerao Date: Mon, 6 Apr 2020 15:17:30 -0500 Subject: [PATCH 1/2] Modified the branch to make the following changes: 1) Reconciled language symbols to match Django 3.0's specification (https://github.com/django/django/blob/master/django/conf/global_settings.py); 2) Replaced {% load staticfiles %} with {% load static %} (https://docs.djangoproject.com/en/dev/releases/3.0/#features-removed-in-3-0, deprecated in 2.1) 3) Fixed a couple tests testing for the visbility and existence of an Entry based on a timestamp - the test dates were not appropriate for the tests, and 4) Fixed a test in tests_views, where only 3 queries were being used instead of 5. All existing tests are passing --- demo/settings.py | 10 +++++----- zinnia/templates/zinnia/skeleton.html | 2 +- zinnia/templates/zinnia/tags/entries_slider.html | 2 +- zinnia/templates/zinnia/tags/search_form.html | 2 +- zinnia/tests/test_entry.py | 4 ++-- zinnia/tests/test_views.py | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/demo/settings.py b/demo/settings.py index 1bed52209..e4061e07c 100644 --- a/demo/settings.py +++ b/demo/settings.py @@ -47,11 +47,11 @@ ('tr', gettext('Turkish')), ('sv', gettext('Swedish')), ('is', gettext('Icelandic')), - ('hr_HR', gettext('Croatian')), - ('pt_BR', gettext('Brazilian Portuguese')), - ('fa_IR', gettext('Persian')), - ('fi_FI', gettext('Finnish')), - ('uk_UA', gettext('Ukrainian')), + ('hr', gettext('Croatian')), + ('pt-br', gettext('Brazilian Portuguese')), + ('fa', gettext('Persian')), + ('fi', gettext('Finnish')), + ('uk', gettext('Ukrainian')), ('zh-hans', gettext('Simplified Chinese')), ) diff --git a/zinnia/templates/zinnia/skeleton.html b/zinnia/templates/zinnia/skeleton.html index f90b2241f..3b1c201ce 100644 --- a/zinnia/templates/zinnia/skeleton.html +++ b/zinnia/templates/zinnia/skeleton.html @@ -1,5 +1,5 @@ {% load i18n %} -{% load staticfiles %} +{% load static %} diff --git a/zinnia/templates/zinnia/tags/entries_slider.html b/zinnia/templates/zinnia/tags/entries_slider.html index 5ea7ac3b0..ee7fd238d 100644 --- a/zinnia/templates/zinnia/tags/entries_slider.html +++ b/zinnia/templates/zinnia/tags/entries_slider.html @@ -1,5 +1,5 @@ {% load i18n %} -{% load staticfiles %} +{% load static %} {% if entries %}
diff --git a/zinnia/templates/zinnia/tags/search_form.html b/zinnia/templates/zinnia/tags/search_form.html index 7531349a4..199e62e24 100644 --- a/zinnia/templates/zinnia/tags/search_form.html +++ b/zinnia/templates/zinnia/tags/search_form.html @@ -1,5 +1,5 @@ {% load i18n %} -{% load staticfiles %} +{% load static %}

diff --git a/zinnia/tests/test_entry.py b/zinnia/tests/test_entry.py index d9da911e5..a3a4b8350 100644 --- a/zinnia/tests/test_entry.py +++ b/zinnia/tests/test_entry.py @@ -158,7 +158,7 @@ def test_trackbacks_are_open(self): def test_is_actual(self): self.assertTrue(self.entry.is_actual) - self.entry.start_publication = datetime(2020, 3, 15) + self.entry.start_publication = timezone.now() + timedelta(days=1) self.assertFalse(self.entry.is_actual) self.entry.start_publication = timezone.now() self.assertTrue(self.entry.is_actual) @@ -169,7 +169,7 @@ def test_is_visible(self): self.assertFalse(self.entry.is_visible) self.entry.status = PUBLISHED self.assertTrue(self.entry.is_visible) - self.entry.start_publication = datetime(2020, 3, 15) + self.entry.start_publication = timezone.now() + timedelta(days=1) self.assertFalse(self.entry.is_visible) def test_short_url(self): diff --git a/zinnia/tests/test_views.py b/zinnia/tests/test_views.py index 755821694..ea2662103 100644 --- a/zinnia/tests/test_views.py +++ b/zinnia/tests/test_views.py @@ -720,7 +720,7 @@ def test_comment_success(self): self.assertEqual(response.context['comment'], comment) comment.is_public = True comment.save() - with self.assertNumQueries(5): + with self.assertNumQueries(3): response = self.client.get(success_url, follow=True) self.assertEqual( response.redirect_chain[1], From bd0ef876642081beb86f6bef65f7482e4e67904a Mon Sep 17 00:00:00 2001 From: Kaustubh Bhalerao Date: Tue, 2 Jun 2020 10:33:06 -0500 Subject: [PATCH 2/2] changed staticfiles in opensearch.xml --- zinnia/templates/zinnia/opensearch.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zinnia/templates/zinnia/opensearch.xml b/zinnia/templates/zinnia/opensearch.xml index 8008c1846..4198f9e56 100644 --- a/zinnia/templates/zinnia/opensearch.xml +++ b/zinnia/templates/zinnia/opensearch.xml @@ -1,4 +1,4 @@ -{% load i18n staticfiles zinnia %}{% get_tags as entry_tags %} +{% load i18n static zinnia %}{% get_tags as entry_tags %} {{ site.name }}