diff --git a/tests/test_views.py b/tests/test_views.py index 444de6a..faa18a0 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -1,7 +1,9 @@ +import datetime from html import escape from django.contrib.auth.models import Group, Permission from django.urls import reverse +from django.utils.timezone import make_naive import pytest @@ -222,6 +224,7 @@ class TestPodcastAdminViews(PodcastAdminViewsMixin, AdminViewTestMixin): .widget.format_value("
Description of this podcast.
") ) form['sound_url'] = 'https://example.org/podcast1.ogg' + form['publish_date'] = '2022-01-01 12:00:00' response = form.submit(status=302) assert response['location'] == self.get_index_url(radio_show) assert escape("'Interview with a person' added") in response.follow() @@ -230,6 +233,9 @@ class TestPodcastAdminViews(PodcastAdminViewsMixin, AdminViewTestMixin): assert podcast.radio_show == radio_show assert podcast.sound_url == 'https://example.org/podcast1.ogg' assert podcast.slug == 'interview-with-a-person' + assert make_naive(podcast.publish_date) == datetime.datetime( + 2022, 1, 1, 12, 0 + ) def test_edit(self): podcast = PodcastFactory() diff --git a/wagtail_webradio/forms.py b/wagtail_webradio/forms.py index 4907711..71507d2 100644 --- a/wagtail_webradio/forms.py +++ b/wagtail_webradio/forms.py @@ -272,5 +272,11 @@ podcast_edit_handler = ObjectList( ], heading=_("Media"), ), + MultiFieldPanel( + [ + FieldPanel('publish_date', heading=_("Date")), + ], + heading=_("Publishing"), + ), ], )