mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Refs #25979 -- Dropped compatiblity for running tests on PostgreSQL < 9.2.
This commit is contained in:
parent
18afd50a2b
commit
36f1f5cfb0
3 changed files with 18 additions and 48 deletions
|
@ -1,12 +1,10 @@
|
|||
import datetime
|
||||
import json
|
||||
import unittest
|
||||
|
||||
from django import forms
|
||||
from django.core import exceptions, serializers
|
||||
from django.db import connection
|
||||
from django.db.models import F
|
||||
from django.test import TestCase, override_settings
|
||||
from django.test import override_settings
|
||||
from django.utils import timezone
|
||||
|
||||
from . import PostgreSQLTestCase
|
||||
|
@ -22,18 +20,7 @@ except ImportError:
|
|||
pass
|
||||
|
||||
|
||||
def skipUnlessPG92(test):
|
||||
try:
|
||||
PG_VERSION = connection.pg_version
|
||||
except AttributeError:
|
||||
PG_VERSION = 0
|
||||
if PG_VERSION < 90200:
|
||||
return unittest.skip('PostgreSQL >= 9.2 required')(test)
|
||||
return test
|
||||
|
||||
|
||||
@skipUnlessPG92
|
||||
class TestSaveLoad(TestCase):
|
||||
class TestSaveLoad(PostgreSQLTestCase):
|
||||
|
||||
def test_all_fields(self):
|
||||
now = timezone.now()
|
||||
|
@ -94,8 +81,7 @@ class TestSaveLoad(TestCase):
|
|||
self.assertIsNone(loaded.ints)
|
||||
|
||||
|
||||
@skipUnlessPG92
|
||||
class TestQuerying(TestCase):
|
||||
class TestQuerying(PostgreSQLTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
|
@ -198,8 +184,7 @@ class TestQuerying(TestCase):
|
|||
)
|
||||
|
||||
|
||||
@skipUnlessPG92
|
||||
class TestQueryingWithRanges(TestCase):
|
||||
class TestQueryingWithRanges(PostgreSQLTestCase):
|
||||
def test_date_range(self):
|
||||
objs = [
|
||||
RangeLookupsModel.objects.create(date='2015-01-01'),
|
||||
|
@ -288,8 +273,7 @@ class TestQueryingWithRanges(TestCase):
|
|||
)
|
||||
|
||||
|
||||
@skipUnlessPG92
|
||||
class TestSerialization(TestCase):
|
||||
class TestSerialization(PostgreSQLTestCase):
|
||||
test_data = (
|
||||
'[{"fields": {"ints": "{\\"upper\\": \\"10\\", \\"lower\\": \\"0\\", '
|
||||
'\\"bounds\\": \\"[)\\"}", "floats": "{\\"empty\\": true}", '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue