From c1f25f8eb8ff8c2b5a5772c94ade81460ba21bd1 Mon Sep 17 00:00:00 2001 From: kyomi Date: Tue, 28 Nov 2023 00:10:04 -0300 Subject: [PATCH] test(apps/tasks): add missing form success URL test --- apps/tasks/tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/tasks/tests.py b/apps/tasks/tests.py index bc1b120..37eb078 100644 --- a/apps/tasks/tests.py +++ b/apps/tasks/tests.py @@ -181,7 +181,7 @@ def test_detail_url_reverse(self) -> None: self.assertEqual(url, expected) -class DetailViewTestCase(TestCase): +class TasksViewTestCase(TestCase): def setUp(self) -> None: now = timezone.now() start_time = now - timedelta(hours=1) @@ -214,6 +214,8 @@ def setUp(self) -> None: ) self.url = reverse("tasks:detail", args=[self.task.id]) + self.view = DetailView() + self.view.object = self.task def test_send_submission_successfully(self) -> None: self.client.force_login(self.user) @@ -289,3 +291,6 @@ def test_handle_submission_with_wrong_output(self) -> None: self.assertEqual(response.status_code, 200) self.assertHTMLEqual(response.content.decode(), expected) + + def test_form_success_url(self) -> None: + self.assertEqual(self.view.get_success_url(), self.url)