PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 2ms RepoModel.GetById 39ms app.codeStats 0ms

/tests/regressiontests/model_permalink/tests.py

https://code.google.com/p/mango-py/
Python | 14 lines | 11 code | 3 blank | 0 comment | 0 complexity | 1da52f5d96b86d5cf76ca423595a6d12 MD5 | raw file
 1from django.test import TestCase
 2from regressiontests.model_permalink.models import Guitarist
 3
 4class PermalinkTests(TestCase):
 5    urls = 'regressiontests.model_permalink.urls'
 6
 7    def test_permalink(self):
 8        g = Guitarist(name='Adrien Moignard', slug='adrienmoignard')
 9        self.assertEqual(g.url(), '/guitarists/adrienmoignard/')
10
11    def test_wrapped_docstring(self):
12        "Methods using the @permalink decorator retain their docstring."
13        g = Guitarist(name='Adrien Moignard', slug='adrienmoignard')
14        self.assertEqual(g.url.__doc__, "Returns the URL for this guitarist.")