Update all tests (and runtests.py)
parent
b996d1c377
commit
adcad20b48
|
|
@ -234,7 +234,7 @@ def _create_model_filter_Q(modellist, not_instance_of=False):
|
||||||
if not modellist:
|
if not modellist:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
from .polymorphic_model import PolymorphicModel
|
from .models import PolymorphicModel
|
||||||
|
|
||||||
if type(modellist) != list and type(modellist) != tuple:
|
if type(modellist) != list and type(modellist) != tuple:
|
||||||
if issubclass(modellist, PolymorphicModel):
|
if issubclass(modellist, PolymorphicModel):
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@ from __future__ import print_function
|
||||||
import uuid
|
import uuid
|
||||||
import re
|
import re
|
||||||
import django
|
import django
|
||||||
from django.utils.unittest import skipIf
|
try:
|
||||||
|
from unittest import skipIf
|
||||||
|
except:
|
||||||
|
# python<2.7
|
||||||
|
from django.utils.unittest import skipIf
|
||||||
from django.db.models.query import QuerySet
|
from django.db.models.query import QuerySet
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
|
@ -15,7 +19,9 @@ from django.db import models
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
|
|
||||||
from polymorphic import PolymorphicModel, PolymorphicManager, PolymorphicQuerySet
|
from polymorphic.models import PolymorphicModel
|
||||||
|
from polymorphic.manager import PolymorphicManager
|
||||||
|
from polymorphic.query import PolymorphicQuerySet
|
||||||
from polymorphic import ShowFieldContent, ShowFieldType, ShowFieldTypeAndContent
|
from polymorphic import ShowFieldContent, ShowFieldType, ShowFieldTypeAndContent
|
||||||
from polymorphic.tools_for_tests import UUIDField
|
from polymorphic.tools_for_tests import UUIDField
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,10 @@ if not settings.configured:
|
||||||
TEMPLATE_LOADERS = (
|
TEMPLATE_LOADERS = (
|
||||||
'django.template.loaders.app_directories.Loader',
|
'django.template.loaders.app_directories.Loader',
|
||||||
),
|
),
|
||||||
TEMPLATE_CONTEXT_PROCESSORS = default_settings.TEMPLATE_CONTEXT_PROCESSORS + (
|
TEMPLATE_CONTEXT_PROCESSORS=(
|
||||||
'django.core.context_processors.request',
|
default_settings.TEMPLATE_CONTEXT_PROCESSORS + [
|
||||||
|
'django.core.context_processors.request',
|
||||||
|
]
|
||||||
),
|
),
|
||||||
TEST_RUNNER = 'django.test.runner.DiscoverRunner' if django.VERSION >= (1,7) else 'django.test.simple.DjangoTestSuiteRunner',
|
TEST_RUNNER = 'django.test.runner.DiscoverRunner' if django.VERSION >= (1,7) else 'django.test.simple.DjangoTestSuiteRunner',
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue