Ticket #14543: patch.diff

File patch.diff, 1.3 KB (added by Sayane, 8 years ago)
  • django/contrib/contenttypes/tests.py

     
    33from django.contrib.contenttypes.models import ContentType
    44from django.contrib.sites.models import Site
    55from django.contrib.contenttypes.views import shortcut
    6 from django.core.exceptions import ObjectDoesNotExist
     6from django.contrib.auth.models import User
    77from django.http import HttpRequest
    88from django.test import TestCase
     9from django.utils import unittest
    910
    10 
    1111class ContentTypesTests(TestCase):
    1212
    1313    def setUp(self):
     
    4646        len(db.connection.queries)
    4747        self.assertEqual(2, len(db.connection.queries))
    4848
     49    @unittest.skipUnless(User._meta.installed, "Requires Auth app")
    4950    def test_shortcut_view(self):
    5051        """
    5152        Check that the shortcut view (used for the admin "view on site"
     
    5859            "SERVER_NAME": "Example.com",
    5960            "SERVER_PORT": "80",
    6061        }
    61         from django.contrib.auth.models import User
    6262        user_ct = ContentType.objects.get_for_model(User)
    6363        obj = User.objects.create(username="john")
    6464        Site._meta.installed = True
Back to Top