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)