1
0
mirror of https://github.com/django/django.git synced 2024-12-27 19:46:22 +00:00
django/tests/regressiontests/model_permalink/tests.py

15 lines
602 B
Python
Raw Normal View History

from django.test import TestCase
from regressiontests.model_permalink.models import Guitarist
class PermalinkTests(TestCase):
urls = 'regressiontests.model_permalink.urls'
def test_permalink(self):
g = Guitarist(name='Adrien Moignard', slug='adrienmoignard')
self.assertEqual(g.url(), '/guitarists/adrienmoignard/')
def test_wrapped_docstring(self):
"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.")