From: Radek Czajka Date: Mon, 25 Jul 2022 11:08:22 +0000 (+0200) Subject: Fix existing tests. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/1986ab5301eff65a3071430ce52158f9104285d0?ds=inline Fix existing tests. --- diff --git a/src/cover/tests.py b/src/cover/tests.py index 838b9bfe..a852f25b 100644 --- a/src/cover/tests.py +++ b/src/cover/tests.py @@ -2,12 +2,12 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.test import TestCase -from cover.forms import FlickrForm +from cover.forms import ImportForm class FlickrTests(TestCase): def test_flickr(self): - form = FlickrForm({"source_url": "https://www.flickr.com/photos/rczajka/6941928577/in/photostream"}) + form = ImportForm({"source_url": "https://www.flickr.com/photos/rczajka/6941928577/in/photostream"}) self.assertTrue(form.is_valid()) self.assertEqual(form.cleaned_data['source_url'], "https://www.flickr.com/photos/rczajka/6941928577/") self.assertEqual(form.cleaned_data['author'], "Radek Czajka@Flickr") diff --git a/src/documents/tests/test_publish.py b/src/documents/tests/test_publish.py index c5813891..4e6592a8 100644 --- a/src/documents/tests/test_publish.py +++ b/src/documents/tests/test_publish.py @@ -26,7 +26,16 @@ class PublishTests(TestCase): def test_publish(self, api_call): self.book[0].head.set_publishable(True) self.book.publish(self.user) - api_call.assert_called_with(self.user, 'books/', {"book_xml": self.text1, "days": 0}, beta=False) + api_call.assert_called_with( + self.user, + 'books/', + { + "book_xml": self.text1, + "days": 0, + "hidden": False + }, + beta=False + ) @patch('apiclient.api_call') def test_publish_multiple(self, api_call): @@ -35,4 +44,13 @@ class PublishTests(TestCase): self.book[1].commit(get_fixture('chunk2.xml')) self.book[1].head.set_publishable(True) self.book.publish(self.user) - api_call.assert_called_with(self.user, 'books/', {"book_xml": get_fixture('expected.xml'), "days": 0}, beta=False) + api_call.assert_called_with( + self.user, + 'books/', + { + "book_xml": get_fixture('expected.xml'), + "days": 0, + "hidden": False + }, + beta=False + )