Tests: remove Django 1.1 compatibility check

fix_request_path_info
Diederik van der Boor 2013-04-05 11:38:56 +02:00
parent 25aa32d7bd
commit 2d83124f51
1 changed files with 16 additions and 22 deletions

View File

@ -6,6 +6,7 @@
from django.conf import settings from django.conf import settings
import sys import sys
from pprint import pprint from pprint import pprint
import uuid
from django import VERSION as django_VERSION from django import VERSION as django_VERSION
from django.conf import settings from django.conf import settings
@ -18,6 +19,7 @@ from django.contrib.contenttypes.models import ContentType
from polymorphic import PolymorphicModel, PolymorphicManager, PolymorphicQuerySet from polymorphic import PolymorphicModel, PolymorphicManager, PolymorphicQuerySet
from polymorphic import ShowFieldContent, ShowFieldType, ShowFieldTypeAndContent, get_version from polymorphic import ShowFieldContent, ShowFieldType, ShowFieldTypeAndContent, get_version
from polymorphic import translate_polymorphic_Q_object from polymorphic import translate_polymorphic_Q_object
from polymorphic.tools_for_tests import UUIDField
class PlainA(models.Model): class PlainA(models.Model):
field1 = models.CharField(max_length=10) field1 = models.CharField(max_length=10)
@ -166,13 +168,6 @@ class Bottom(Middle):
author = models.CharField(max_length=50) author = models.CharField(max_length=50)
# UUID tests won't work with Django 1.1
if not (django_VERSION[0] <= 1 and django_VERSION[1] <= 1):
try: from polymorphic.tools_for_tests import UUIDField
except: pass
if 'UUIDField' in globals():
import uuid
class UUIDProject(ShowFieldTypeAndContent, PolymorphicModel): class UUIDProject(ShowFieldTypeAndContent, PolymorphicModel):
uuid_primary_key = UUIDField(primary_key = True) uuid_primary_key = UUIDField(primary_key = True)
topic = models.CharField(max_length = 30) topic = models.CharField(max_length = 30)
@ -303,7 +298,6 @@ class PolymorphicTests(TestCase):
def test_primary_key_custom_field_problem(self): def test_primary_key_custom_field_problem(self):
"object retrieval problem occuring with some custom primary key fields (UUIDField as test case)" "object retrieval problem occuring with some custom primary key fields (UUIDField as test case)"
if not 'UUIDField' in globals(): return
a=UUIDProject.objects.create(topic="John's gathering") a=UUIDProject.objects.create(topic="John's gathering")
b=UUIDArtProject.objects.create(topic="Sculpting with Tim", artist="T. Turner") b=UUIDArtProject.objects.create(topic="Sculpting with Tim", artist="T. Turner")
c=UUIDResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter") c=UUIDResearchProject.objects.create(topic="Swallow Aerodynamics", supervisor="Dr. Winter")