mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #5496 -- Added test cases for some of the built-in Django views. Thanks to Manuel Saelices <msaelices@yaco.es> for the original patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
24
tests/regressiontests/views/models.py
Normal file
24
tests/regressiontests/views/models.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""
|
||||
Regression tests for Django built-in views
|
||||
"""
|
||||
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
|
||||
class Author(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.name
|
||||
|
||||
def get_absolute_url(self):
|
||||
return '/views/authors/%s/' % self.id
|
||||
|
||||
|
||||
class Article(models.Model):
|
||||
title = models.CharField(max_length=100)
|
||||
author = models.ForeignKey(Author)
|
||||
|
||||
def __unicode__(self):
|
||||
return self.title
|
||||
|
||||
Reference in New Issue
Block a user