Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
test(apps/tasks): add missing form success URL test
Browse files Browse the repository at this point in the history
  • Loading branch information
bitterteriyaki committed Nov 28, 2023
1 parent 7a6f34b commit c1f25f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/tasks/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit c1f25f8

Please sign in to comment.