mirror of
https://github.com/django/django.git
synced 2025-10-26 07:06:08 +00:00
refs #12836 - Added a test to assure permalink wraps method attributes
This commit is contained in:
@@ -16,3 +16,12 @@ class PermalinkTests(TestCase):
|
||||
"Methods using the @permalink decorator retain their docstring."
|
||||
g = Guitarist(name='Adrien Moignard', slug='adrienmoignard')
|
||||
self.assertEqual(g.url.__doc__, "Returns the URL for this guitarist.")
|
||||
|
||||
def test_wrapped_attribute(self):
|
||||
"""
|
||||
Methods using the @permalink decorator can have attached attributes
|
||||
from other decorators
|
||||
"""
|
||||
g = Guitarist(name='Adrien Moignard', slug='adrienmoignard')
|
||||
self.assertTrue(hasattr(g.url_with_attribute, 'attribute'))
|
||||
self.assertEqual(g.url_with_attribute.attribute, 'value')
|
||||
|
||||
Reference in New Issue
Block a user