diff options
Diffstat (limited to 'tests/postgres_tests/test_hstore.py')
| -rw-r--r-- | tests/postgres_tests/test_hstore.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py index a51cb4e66f..0a2d77e4a4 100644 --- a/tests/postgres_tests/test_hstore.py +++ b/tests/postgres_tests/test_hstore.py @@ -2,9 +2,9 @@ import json from django.core import checks, exceptions, serializers from django.forms import Form -from django.test.utils import isolate_apps, modify_settings +from django.test.utils import isolate_apps -from . import PostgreSQLTestCase +from . import PostgreSQLSimpleTestCase, PostgreSQLTestCase from .models import HStoreModel, PostgreSQLModel try: @@ -15,12 +15,7 @@ except ImportError: pass -@modify_settings(INSTALLED_APPS={'append': 'django.contrib.postgres'}) -class HStoreTestCase(PostgreSQLTestCase): - pass - - -class SimpleTests(HStoreTestCase): +class SimpleTests(PostgreSQLTestCase): def test_save_load_success(self): value = {'a': 'b'} instance = HStoreModel(field=value) @@ -69,7 +64,7 @@ class SimpleTests(HStoreTestCase): self.assertEqual(instance.array_field, expected_value) -class TestQuerying(HStoreTestCase): +class TestQuerying(PostgreSQLTestCase): def setUp(self): self.objs = [ @@ -191,7 +186,7 @@ class TestQuerying(HStoreTestCase): @isolate_apps('postgres_tests') -class TestChecks(PostgreSQLTestCase): +class TestChecks(PostgreSQLSimpleTestCase): def test_invalid_default(self): class MyModel(PostgreSQLModel): @@ -218,7 +213,7 @@ class TestChecks(PostgreSQLTestCase): self.assertEqual(MyModel().check(), []) -class TestSerialization(HStoreTestCase): +class TestSerialization(PostgreSQLSimpleTestCase): test_data = json.dumps([{ 'model': 'postgres_tests.hstoremodel', 'pk': None, @@ -248,7 +243,7 @@ class TestSerialization(HStoreTestCase): self.assertEqual(instance.field, new_instance.field) -class TestValidation(HStoreTestCase): +class TestValidation(PostgreSQLSimpleTestCase): def test_not_a_string(self): field = HStoreField() @@ -262,7 +257,7 @@ class TestValidation(HStoreTestCase): self.assertEqual(field.clean({'a': None}, None), {'a': None}) -class TestFormField(HStoreTestCase): +class TestFormField(PostgreSQLSimpleTestCase): def test_valid(self): field = forms.HStoreField() @@ -325,7 +320,7 @@ class TestFormField(HStoreTestCase): self.assertTrue(form_w_hstore.has_changed()) -class TestValidator(HStoreTestCase): +class TestValidator(PostgreSQLSimpleTestCase): def test_simple_valid(self): validator = KeysValidator(keys=['a', 'b']) |
