mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +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:
committed by
Sarah Boyce
parent
be138f32ed
commit
4d11ea1ef0
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user