2011-10-13 21:34:56 +00:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2011-03-14 05:22:39 +00:00
|
|
|
from django.test import TestCase
|
2011-10-13 21:34:56 +00:00
|
|
|
|
|
|
|
from .models import Guitarist
|
|
|
|
|
2011-03-14 05:22:39 +00:00
|
|
|
|
|
|
|
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.")
|