1
0
mirror of https://github.com/django/django.git synced 2025-10-24 14:16:09 +00:00

Fixed #28999 -- Documented how to reverse a class-based view by instance.

Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
This commit is contained in:
Clifford Gama
2024-10-22 14:12:02 +02:00
committed by Sarah Boyce
parent be138f32ed
commit 4d11ea1ef0
4 changed files with 27 additions and 6 deletions

View File

@@ -522,12 +522,12 @@ class URLPatternReverse(SimpleTestCase):
with self.assertRaisesMessage(NoReverseMatch, msg):
reverse("places", kwargs={"arg1": 2})
def test_func_view_from_cbv(self):
def test_view_func_from_cbv(self):
expected = "/hello/world/"
url = reverse(views.view_func_from_cbv, kwargs={"name": "world"})
self.assertEqual(url, expected)
def test_func_view_from_cbv_no_expected_kwarg(self):
def test_view_func_from_cbv_no_expected_kwarg(self):
with self.assertRaises(NoReverseMatch):
reverse(views.view_func_from_cbv)