Ticket #12836: test.diff
File test.diff, 791 bytes (added by , 15 years ago) |
---|
-
tests/modeltests/utils/models.py
1 from django.db import models 2 3 def set_attr(name, value): 4 def wrapper(function): 5 setattr(function, name, value) 6 return function 7 return wrapper 8 9 class Empty(models.Model): 10 @models.permalink 11 @set_attr('test', 'test') 12 def get_absolute_url(self): 13 pass 14 15 __test__ = {'API_TESTS': """ 16 # Access get_absolute_url attributes after in model instance. 17 >>> Empty().get_absolute_url.test == 'test' 18 True 19 """}