diff --git a/django/contrib/contenttypes/tests.py b/django/contrib/contenttypes/tests.py
index 790193b..a26956d 100644
a
|
b
|
|
| 1 | import urllib |
1 | 2 | from django import db |
2 | 3 | from django.conf import settings |
3 | 4 | from django.contrib.contenttypes.models import ContentType |
… |
… |
from django.contrib.contenttypes.views import shortcut
|
6 | 7 | from django.core.exceptions import ObjectDoesNotExist |
7 | 8 | from django.http import HttpRequest |
8 | 9 | from django.test import TestCase |
| 10 | from django.db import models |
| 11 | from django.utils.translation import ugettext_lazy as _ |
| 12 | from django.utils.encoding import smart_str |
9 | 13 | |
| 14 | class User(models.Model): |
| 15 | """fake User table for test_shortcut_view""" |
| 16 | username = models.CharField(_('username'), max_length=30, unique=True, help_text=_("Required. 30 characters or fewer. Letters, numbers and @/./+/-/_ characters")) |
| 17 | class Meta: |
| 18 | verbose_name = _('user') |
| 19 | verbose_name_plural = _('users') |
| 20 | |
| 21 | def __unicode__(self): |
| 22 | return self.username |
| 23 | |
| 24 | def get_absolute_url(self): |
| 25 | return "/users/%s/" % urllib.quote(smart_str(self.username)) |
10 | 26 | |
11 | 27 | class ContentTypesTests(TestCase): |
12 | 28 | |
… |
… |
class ContentTypesTests(TestCase):
|
58 | 74 | "SERVER_NAME": "Example.com", |
59 | 75 | "SERVER_PORT": "80", |
60 | 76 | } |
61 | | from django.contrib.auth.models import User |
62 | 77 | user_ct = ContentType.objects.get_for_model(User) |
63 | 78 | obj = User.objects.create(username="john") |
64 | 79 | |