Loading tests/postgres_tests/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -5,5 +5,5 @@ from django.test import TestCase @unittest.skipUnless(connection.vendor == 'postgresql', "PostgreSQL specific tests") class PostgresSQLTestCase(TestCase): class PostgreSQLTestCase(TestCase): pass tests/postgres_tests/test_aggregates.py +3 −3 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -111,7 +111,7 @@ class TestGeneralAggregate(PostgresSQLTestCase): self.assertEqual(values, {'stringagg': ''}) class TestStatisticsAggregate(PostgresSQLTestCase): class TestStatisticsAggregate(PostgreSQLTestCase): @classmethod def setUpTestData(cls): StatTestModel.objects.create( Loading tests/postgres_tests/test_array.py +8 −8 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -23,7 +23,7 @@ except ImportError: pass class TestSaveLoad(PostgresSQLTestCase): class TestSaveLoad(PostgreSQLTestCase): def test_integer(self): instance = IntegerArrayModel(field=[1, 2, 3]) Loading Loading @@ -98,7 +98,7 @@ class TestSaveLoad(PostgresSQLTestCase): self.assertEqual(instance.decimals, loaded.decimals) class TestQuerying(PostgresSQLTestCase): class TestQuerying(PostgreSQLTestCase): def setUp(self): self.objs = [ Loading Loading @@ -229,7 +229,7 @@ class TestQuerying(PostgresSQLTestCase): ) class TestChecks(PostgresSQLTestCase): class TestChecks(PostgreSQLTestCase): def test_field_checks(self): field = ArrayField(models.CharField()) Loading Loading @@ -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): Loading @@ -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()) Loading Loading @@ -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()) Loading Loading @@ -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): Loading tests/postgres_tests/test_hstore.py +7 −7 Original line number Diff line number Diff line Loading @@ -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: Loading @@ -14,7 +14,7 @@ except ImportError: pass class SimpleTests(PostgresSQLTestCase): class SimpleTests(PostgreSQLTestCase): apps = ['django.contrib.postgres'] def test_save_load_success(self): Loading @@ -38,7 +38,7 @@ class SimpleTests(PostgresSQLTestCase): self.assertEqual(reloaded.field, value) class TestQuerying(PostgresSQLTestCase): class TestQuerying(PostgreSQLTestCase): def setUp(self): self.objs = [ Loading Loading @@ -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): Loading @@ -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() Loading @@ -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() Loading Loading @@ -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']) Loading tests/postgres_tests/test_json.py +3 −3 Original line number Diff line number Diff line Loading @@ -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: Loading Loading @@ -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() Loading @@ -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() Loading Loading
tests/postgres_tests/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -5,5 +5,5 @@ from django.test import TestCase @unittest.skipUnless(connection.vendor == 'postgresql', "PostgreSQL specific tests") class PostgresSQLTestCase(TestCase): class PostgreSQLTestCase(TestCase): pass
tests/postgres_tests/test_aggregates.py +3 −3 Original line number Diff line number Diff line Loading @@ -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) Loading Loading @@ -111,7 +111,7 @@ class TestGeneralAggregate(PostgresSQLTestCase): self.assertEqual(values, {'stringagg': ''}) class TestStatisticsAggregate(PostgresSQLTestCase): class TestStatisticsAggregate(PostgreSQLTestCase): @classmethod def setUpTestData(cls): StatTestModel.objects.create( Loading
tests/postgres_tests/test_array.py +8 −8 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -23,7 +23,7 @@ except ImportError: pass class TestSaveLoad(PostgresSQLTestCase): class TestSaveLoad(PostgreSQLTestCase): def test_integer(self): instance = IntegerArrayModel(field=[1, 2, 3]) Loading Loading @@ -98,7 +98,7 @@ class TestSaveLoad(PostgresSQLTestCase): self.assertEqual(instance.decimals, loaded.decimals) class TestQuerying(PostgresSQLTestCase): class TestQuerying(PostgreSQLTestCase): def setUp(self): self.objs = [ Loading Loading @@ -229,7 +229,7 @@ class TestQuerying(PostgresSQLTestCase): ) class TestChecks(PostgresSQLTestCase): class TestChecks(PostgreSQLTestCase): def test_field_checks(self): field = ArrayField(models.CharField()) Loading Loading @@ -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): Loading @@ -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()) Loading Loading @@ -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()) Loading Loading @@ -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): Loading
tests/postgres_tests/test_hstore.py +7 −7 Original line number Diff line number Diff line Loading @@ -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: Loading @@ -14,7 +14,7 @@ except ImportError: pass class SimpleTests(PostgresSQLTestCase): class SimpleTests(PostgreSQLTestCase): apps = ['django.contrib.postgres'] def test_save_load_success(self): Loading @@ -38,7 +38,7 @@ class SimpleTests(PostgresSQLTestCase): self.assertEqual(reloaded.field, value) class TestQuerying(PostgresSQLTestCase): class TestQuerying(PostgreSQLTestCase): def setUp(self): self.objs = [ Loading Loading @@ -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): Loading @@ -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() Loading @@ -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() Loading Loading @@ -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']) Loading
tests/postgres_tests/test_json.py +3 −3 Original line number Diff line number Diff line Loading @@ -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: Loading Loading @@ -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() Loading @@ -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() Loading