Name PostgreSQL correctly.
This commit is contained in:
parent
33ea472f69
commit
00e8e514e1
|
@ -5,5 +5,5 @@ from django.test import TestCase
|
|||
|
||||
|
||||
@unittest.skipUnless(connection.vendor == 'postgresql', "PostgreSQL specific tests")
|
||||
class PostgresSQLTestCase(TestCase):
|
||||
class PostgreSQLTestCase(TestCase):
|
||||
pass
|
||||
|
|
|
@ -6,11 +6,11 @@ from django.contrib.postgres.aggregates import (
|
|||
from django.db.models.expressions import F, Value
|
||||
from django.test.utils import Approximate
|
||||
|
||||
from . import PostgresSQLTestCase
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import AggregateTestModel, StatTestModel
|
||||
|
||||
|
||||
class TestGeneralAggregate(PostgresSQLTestCase):
|
||||
class TestGeneralAggregate(PostgreSQLTestCase):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
AggregateTestModel.objects.create(boolean_field=True, char_field='Foo1', integer_field=0)
|
||||
|
@ -111,7 +111,7 @@ class TestGeneralAggregate(PostgresSQLTestCase):
|
|||
self.assertEqual(values, {'stringagg': ''})
|
||||
|
||||
|
||||
class TestStatisticsAggregate(PostgresSQLTestCase):
|
||||
class TestStatisticsAggregate(PostgreSQLTestCase):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
StatTestModel.objects.create(
|
||||
|
|
|
@ -10,7 +10,7 @@ from django.db import IntegrityError, connection, models
|
|||
from django.test import TransactionTestCase, override_settings
|
||||
from django.utils import timezone
|
||||
|
||||
from . import PostgresSQLTestCase
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import (
|
||||
ArrayFieldSubclass, CharArrayModel, DateTimeArrayModel, IntegerArrayModel,
|
||||
NestedIntegerArrayModel, NullableIntegerArrayModel, OtherTypesArrayModel,
|
||||
|
@ -23,7 +23,7 @@ except ImportError:
|
|||
pass
|
||||
|
||||
|
||||
class TestSaveLoad(PostgresSQLTestCase):
|
||||
class TestSaveLoad(PostgreSQLTestCase):
|
||||
|
||||
def test_integer(self):
|
||||
instance = IntegerArrayModel(field=[1, 2, 3])
|
||||
|
@ -98,7 +98,7 @@ class TestSaveLoad(PostgresSQLTestCase):
|
|||
self.assertEqual(instance.decimals, loaded.decimals)
|
||||
|
||||
|
||||
class TestQuerying(PostgresSQLTestCase):
|
||||
class TestQuerying(PostgreSQLTestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.objs = [
|
||||
|
@ -229,7 +229,7 @@ class TestQuerying(PostgresSQLTestCase):
|
|||
)
|
||||
|
||||
|
||||
class TestChecks(PostgresSQLTestCase):
|
||||
class TestChecks(PostgreSQLTestCase):
|
||||
|
||||
def test_field_checks(self):
|
||||
field = ArrayField(models.CharField())
|
||||
|
@ -294,7 +294,7 @@ class TestMigrations(TransactionTestCase):
|
|||
self.assertNotIn(table_name, connection.introspection.table_names(cursor))
|
||||
|
||||
|
||||
class TestSerialization(PostgresSQLTestCase):
|
||||
class TestSerialization(PostgreSQLTestCase):
|
||||
test_data = '[{"fields": {"field": "[\\"1\\", \\"2\\"]"}, "model": "postgres_tests.integerarraymodel", "pk": null}]'
|
||||
|
||||
def test_dumping(self):
|
||||
|
@ -307,7 +307,7 @@ class TestSerialization(PostgresSQLTestCase):
|
|||
self.assertEqual(instance.field, [1, 2])
|
||||
|
||||
|
||||
class TestValidation(PostgresSQLTestCase):
|
||||
class TestValidation(PostgreSQLTestCase):
|
||||
|
||||
def test_unbounded(self):
|
||||
field = ArrayField(models.IntegerField())
|
||||
|
@ -345,7 +345,7 @@ class TestValidation(PostgresSQLTestCase):
|
|||
self.assertEqual(cm.exception.messages[0], 'Item 0 in the array did not validate: Ensure this value is greater than or equal to 1.')
|
||||
|
||||
|
||||
class TestSimpleFormField(PostgresSQLTestCase):
|
||||
class TestSimpleFormField(PostgreSQLTestCase):
|
||||
|
||||
def test_valid(self):
|
||||
field = SimpleArrayField(forms.CharField())
|
||||
|
@ -417,7 +417,7 @@ class TestSimpleFormField(PostgresSQLTestCase):
|
|||
self.assertEqual(form_field.max_length, 4)
|
||||
|
||||
|
||||
class TestSplitFormField(PostgresSQLTestCase):
|
||||
class TestSplitFormField(PostgreSQLTestCase):
|
||||
|
||||
def test_valid(self):
|
||||
class SplitForm(forms.Form):
|
||||
|
|
|
@ -3,7 +3,7 @@ import json
|
|||
from django.core import exceptions, serializers
|
||||
from django.forms import Form
|
||||
|
||||
from . import PostgresSQLTestCase
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import HStoreModel
|
||||
|
||||
try:
|
||||
|
@ -14,7 +14,7 @@ except ImportError:
|
|||
pass
|
||||
|
||||
|
||||
class SimpleTests(PostgresSQLTestCase):
|
||||
class SimpleTests(PostgreSQLTestCase):
|
||||
apps = ['django.contrib.postgres']
|
||||
|
||||
def test_save_load_success(self):
|
||||
|
@ -38,7 +38,7 @@ class SimpleTests(PostgresSQLTestCase):
|
|||
self.assertEqual(reloaded.field, value)
|
||||
|
||||
|
||||
class TestQuerying(PostgresSQLTestCase):
|
||||
class TestQuerying(PostgreSQLTestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.objs = [
|
||||
|
@ -133,7 +133,7 @@ class TestQuerying(PostgresSQLTestCase):
|
|||
)
|
||||
|
||||
|
||||
class TestSerialization(PostgresSQLTestCase):
|
||||
class TestSerialization(PostgreSQLTestCase):
|
||||
test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]'
|
||||
|
||||
def test_dumping(self):
|
||||
|
@ -146,7 +146,7 @@ class TestSerialization(PostgresSQLTestCase):
|
|||
self.assertEqual(instance.field, {'a': 'b'})
|
||||
|
||||
|
||||
class TestValidation(PostgresSQLTestCase):
|
||||
class TestValidation(PostgreSQLTestCase):
|
||||
|
||||
def test_not_a_string(self):
|
||||
field = HStoreField()
|
||||
|
@ -156,7 +156,7 @@ class TestValidation(PostgresSQLTestCase):
|
|||
self.assertEqual(cm.exception.message % cm.exception.params, 'The value of "a" is not a string.')
|
||||
|
||||
|
||||
class TestFormField(PostgresSQLTestCase):
|
||||
class TestFormField(PostgreSQLTestCase):
|
||||
|
||||
def test_valid(self):
|
||||
field = forms.HStoreField()
|
||||
|
@ -192,7 +192,7 @@ class TestFormField(PostgresSQLTestCase):
|
|||
self.assertFalse(form_w_hstore.has_changed())
|
||||
|
||||
|
||||
class TestValidator(PostgresSQLTestCase):
|
||||
class TestValidator(PostgreSQLTestCase):
|
||||
|
||||
def test_simple_valid(self):
|
||||
validator = KeysValidator(keys=['a', 'b'])
|
||||
|
|
|
@ -5,7 +5,7 @@ from django.core import exceptions, serializers
|
|||
from django.db import connection
|
||||
from django.test import TestCase
|
||||
|
||||
from . import PostgresSQLTestCase
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import JSONModel
|
||||
|
||||
try:
|
||||
|
@ -219,7 +219,7 @@ class TestSerialization(TestCase):
|
|||
self.assertEqual(instance.field, {'a': 'b'})
|
||||
|
||||
|
||||
class TestValidation(PostgresSQLTestCase):
|
||||
class TestValidation(PostgreSQLTestCase):
|
||||
|
||||
def test_not_serializable(self):
|
||||
field = JSONField()
|
||||
|
@ -229,7 +229,7 @@ class TestValidation(PostgresSQLTestCase):
|
|||
self.assertEqual(cm.exception.message % cm.exception.params, "Value must be valid JSON.")
|
||||
|
||||
|
||||
class TestFormField(PostgresSQLTestCase):
|
||||
class TestFormField(PostgreSQLTestCase):
|
||||
|
||||
def test_valid(self):
|
||||
field = forms.JSONField()
|
||||
|
|
|
@ -8,7 +8,7 @@ from django.db import connection
|
|||
from django.test import TestCase, override_settings
|
||||
from django.utils import timezone
|
||||
|
||||
from . import PostgresSQLTestCase
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import RangesModel
|
||||
|
||||
try:
|
||||
|
@ -222,7 +222,7 @@ class TestSerialization(TestCase):
|
|||
self.assertEqual(instance.dates, None)
|
||||
|
||||
|
||||
class TestValidators(PostgresSQLTestCase):
|
||||
class TestValidators(PostgreSQLTestCase):
|
||||
|
||||
def test_max(self):
|
||||
validator = RangeMaxValueValidator(5)
|
||||
|
@ -241,7 +241,7 @@ class TestValidators(PostgresSQLTestCase):
|
|||
self.assertEqual(cm.exception.code, 'min_value')
|
||||
|
||||
|
||||
class TestFormField(PostgresSQLTestCase):
|
||||
class TestFormField(PostgreSQLTestCase):
|
||||
|
||||
def test_valid_integer(self):
|
||||
field = pg_forms.IntegerRangeField()
|
||||
|
@ -508,7 +508,7 @@ class TestFormField(PostgresSQLTestCase):
|
|||
self.assertIsInstance(form_field, pg_forms.DateTimeRangeField)
|
||||
|
||||
|
||||
class TestWidget(PostgresSQLTestCase):
|
||||
class TestWidget(PostgreSQLTestCase):
|
||||
def test_range_widget(self):
|
||||
f = pg_forms.ranges.DateTimeRangeField()
|
||||
self.assertHTMLEqual(
|
||||
|
|
|
@ -3,12 +3,12 @@ from __future__ import unicode_literals
|
|||
|
||||
from django.test import modify_settings
|
||||
|
||||
from . import PostgresSQLTestCase
|
||||
from . import PostgreSQLTestCase
|
||||
from .models import CharFieldModel, TextFieldModel
|
||||
|
||||
|
||||
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'})
|
||||
class UnaccentTest(PostgresSQLTestCase):
|
||||
class UnaccentTest(PostgreSQLTestCase):
|
||||
|
||||
Model = CharFieldModel
|
||||
|
||||
|
|
Loading…
Reference in New Issue