mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	git-svn-id: http://code.djangoproject.com/svn/django/trunk@16981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
		
			
				
	
	
		
			19 lines
		
	
	
		
			613 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			613 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from __future__ import absolute_import
 | |
| 
 | |
| from django.test import TestCase
 | |
| 
 | |
| from .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.")
 |