diff --git a/.coveragerc b/.coveragerc old mode 100755 new mode 100644 diff --git a/.gitignore b/.gitignore old mode 100755 new mode 100644 diff --git a/.landscape.yml b/.landscape.yml old mode 100755 new mode 100644 diff --git a/.travis.yml b/.travis.yml old mode 100755 new mode 100644 index da0c51b..ecab39e --- a/.travis.yml +++ b/.travis.yml @@ -10,14 +10,16 @@ python: - "2.6" env: + - DJANGO="django==1.8" - DJANGO="django==1.7.7" - DJANGO="django==1.6.11" - - DJANGO="django==1.5.12" matrix: exclude: - python: "2.6" env: DJANGO="django==1.7.7" + - python: "2.6" + env: DJANGO="django==1.8" branches: only: diff --git a/AUTHORS b/AUTHORS old mode 100755 new mode 100644 diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst old mode 100755 new mode 100644 diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.rst b/README.rst old mode 100755 new mode 100644 diff --git a/django_hstore/__init__.py b/django_hstore/__init__.py index 167841a..9cba0d5 100644 --- a/django_hstore/__init__.py +++ b/django_hstore/__init__.py @@ -1,4 +1,4 @@ -VERSION = (1, 3, 8, 'final') +VERSION = (1, 4, 0, 'alpha') __version__ = VERSION diff --git a/django_hstore/apps.py b/django_hstore/apps.py old mode 100755 new mode 100644 index 49b264c..1091fe8 --- a/django_hstore/apps.py +++ b/django_hstore/apps.py @@ -73,16 +73,15 @@ def attach_handler(self, func, vendor=None, unique=False): def register_hstore_handler(connection, **kwargs): # do not register hstore if DB is not postgres # do not register if HAS_HSTORE flag is set to false - if connection.vendor != 'postgresql' or \ connection.settings_dict.get('HAS_HSTORE', True) is False: return - # if the ``NAME`` of the database in the connection settings is ``None`` # defer hstore registration by setting up a new unique handler if connection.settings_dict['NAME'] is None: connection_handler.attach_handler(register_hstore_handler, - vendor="postgresql", unique=HSTORE_REGISTER_GLOBALLY) + vendor="postgresql", + unique=HSTORE_REGISTER_GLOBALLY) return if sys.version_info[0] < 3: @@ -92,7 +91,8 @@ def register_hstore_handler(connection, **kwargs): connection_handler.attach_handler(register_hstore_handler, - vendor="postgresql", unique=HSTORE_REGISTER_GLOBALLY) + vendor="postgresql", + unique=HSTORE_REGISTER_GLOBALLY) class HStoreConfig(AppConfig): diff --git a/django_hstore/compat.py b/django_hstore/compat.py old mode 100755 new mode 100644 diff --git a/django_hstore/descriptors.py b/django_hstore/descriptors.py old mode 100755 new mode 100644 diff --git a/django_hstore/dict.py b/django_hstore/dict.py old mode 100755 new mode 100644 diff --git a/django_hstore/exceptions.py b/django_hstore/exceptions.py old mode 100755 new mode 100644 diff --git a/django_hstore/fields.py b/django_hstore/fields.py old mode 100755 new mode 100644 index 38155fb..f7533e9 --- a/django_hstore/fields.py +++ b/django_hstore/fields.py @@ -197,16 +197,30 @@ def _remove_hstore_virtual_fields(self): for field_name in cls._hstore_virtual_fields.keys(): delattr(cls, field_name) delattr(cls, '_hstore_virtual_fields') - # remove all hstore virtual fields from meta - for meta_fields in ['fields', 'local_fields', 'virtual_fields']: + # django >= 1.8 + if get_version()[0:3] >= '1.8': + # remove all hstore virtual fields from meta hstore_fields = [] # get all the existing hstore virtual fields - for field in getattr(cls._meta, meta_fields): + for field in getattr(cls._meta, 'virtual_fields'): if hasattr(field, 'hstore_field_name'): hstore_fields.append(field) # remove from meta for field in hstore_fields: - getattr(cls._meta, meta_fields).remove(field) + getattr(cls._meta, 'virtual_fields').remove(field) + # django <= 1.7 + # TODO: will be removed in future versions + else: + # remove all hstore virtual fields from meta + for meta_fields in ['fields', 'local_fields', 'virtual_fields']: + hstore_fields = [] + # get all the existing hstore virtual fields + for field in getattr(cls._meta, meta_fields): + if hasattr(field, 'hstore_field_name'): + hstore_fields.append(field) + # remove from meta + for field in hstore_fields: + getattr(cls._meta, meta_fields).remove(field) class ReferencesField(HStoreField): @@ -236,7 +250,6 @@ def _value_to_python(self, value): class SerializedDictionaryField(HStoreField): - description = _("A python dictionary in a postgresql hstore field.") def __init__(self, serializer=json.dumps, deserializer=json.loads, *args, **kwargs): diff --git a/django_hstore/forms.py b/django_hstore/forms.py old mode 100755 new mode 100644 diff --git a/django_hstore/hstore.py b/django_hstore/hstore.py old mode 100755 new mode 100644 diff --git a/django_hstore/lookups.py b/django_hstore/lookups.py old mode 100755 new mode 100644 index 3bf1a78..ea44889 --- a/django_hstore/lookups.py +++ b/django_hstore/lookups.py @@ -39,9 +39,9 @@ class HStoreComparisonLookupMixin(HStoreLookupMixin): Mixin for hstore comparison custom lookups. """ - def as_postgresql(self, qn, connection): - lhs, lhs_params = self.process_lhs(qn, connection) - rhs, rhs_params = self.process_rhs(qn, connection) + def as_postgresql(self, compiler, connection): + lhs, lhs_params = self.process_lhs(compiler, connection) + rhs, rhs_params = self.process_rhs(compiler, connection) if len(rhs_params) == 1 and isinstance(rhs_params[0], dict): param = rhs_params[0] sign = (self.lookup_name[0] == 'g' and '>%s' or '<%s') % (self.lookup_name[-1] == 'e' and '=' or '') @@ -75,8 +75,8 @@ class HStoreLessThanOrEqual(HStoreComparisonLookupMixin, LessThanOrEqual): class HStoreContains(HStoreLookupMixin, Contains): - def as_postgresql(self, qn, connection): - lhs, lhs_params = self.process_lhs(qn, connection) + def as_postgresql(self, compiler, connection): + lhs, lhs_params = self.process_lhs(compiler, connection) # FIXME: ::text cast is added by ``django.db.backends.postgresql_psycopg2.DatabaseOperations.lookup_cast``; # maybe there's a cleaner way to fix the cast for hstore columns if lhs.endswith('::text'): @@ -105,15 +105,16 @@ def as_postgresql(self, qn, connection): # if looking for a string perform the normal text lookup # that is: look for occurence of string in all the keys pass - elif hasattr(self.lhs.source, 'serializer'): + # needed for SerializedDictionaryField + elif hasattr(self.lhs.target, 'serializer'): try: - self.lhs.source._serialize_value(param) + self.lhs.target._serialize_value(param) pass except Exception: raise ValueError('invalid value') else: raise ValueError('invalid value') - return super(HStoreContains, self).as_sql(qn, connection) + return super(HStoreContains, self).as_sql(compiler, connection) class HStoreIContains(IContains, HStoreContains): @@ -122,8 +123,8 @@ class HStoreIContains(IContains, HStoreContains): class HStoreIsNull(IsNull): - def as_postgresql(self, qn, connection): - lhs, lhs_params = self.process_lhs(qn, connection) + def as_postgresql(self, compiler, connection): + lhs, lhs_params = self.process_lhs(compiler, connection) if isinstance(self.rhs, dict): param = self.rhs @@ -136,4 +137,4 @@ def as_postgresql(self, qn, connection): return (" AND ".join(conditions), lhs_params) - return super(HStoreIsNull, self).as_sql(qn, connection) + return super(HStoreIsNull, self).as_sql(compiler, connection) diff --git a/django_hstore/managers.py b/django_hstore/managers.py old mode 100755 new mode 100644 diff --git a/django_hstore/models.py b/django_hstore/models.py old mode 100755 new mode 100644 diff --git a/django_hstore/query.py b/django_hstore/query.py old mode 100755 new mode 100644 index e120525..d4254da --- a/django_hstore/query.py +++ b/django_hstore/query.py @@ -29,24 +29,8 @@ def updater(self, *args, **params): self._for_write = True query = method(self, self.query.clone(UpdateQuery), *args, **params) forced_managed = False - # django >= 1.6 - if VERSION[:2] >= (1, 6): - with transaction.atomic(using=self.db): - rows = query.get_compiler(self.db).execute_sql(None) - # django <= 1.5 - TODO: remove soon - else: - if not transaction.is_managed(using=self.db): - transaction.enter_transaction_management(using=self.db) - forced_managed = True - try: - rows = query.get_compiler(self.db).execute_sql(None) - if forced_managed: - transaction.commit(using=self.db) - else: - transaction.commit_unless_managed(using=self.db) - finally: - if forced_managed: - transaction.leave_transaction_management(using=self.db) + with transaction.atomic(using=self.db): + rows = query.get_compiler(self.db).execute_sql(None) self._result_cache = None return rows updater.alters_data = True @@ -87,7 +71,7 @@ def add(self, data, *args, **kwargs): # FIXME: this method shuld be more clear. def make_atom(self, child, qn, connection): lvalue, lookup_type, value_annot, param = child - kwargs = {'connection': connection} if VERSION[:2] >= (1, 3) else {} + kwargs = {'connection': connection} if lvalue and lvalue.field and hasattr(lvalue.field, 'db_type') and lvalue.field.db_type(**kwargs) == 'hstore': try: @@ -225,24 +209,29 @@ def hupdate(self, query, attr, updates): if GEODJANGO_INSTALLED: from django.contrib.gis.db.models.query import GeoQuerySet - from django.contrib.gis.db.models.sql.query import GeoQuery - from django.contrib.gis.db.models.sql.where import GeoWhereNode, GeoConstraint - - class HStoreGeoWhereNode(HStoreWhereNode, GeoWhereNode): - def make_atom(self, child, qn, connection): - lvalue, lookup_type, value_annot, params_or_value = child - # if spatial query - if isinstance(lvalue, GeoConstraint): - return GeoWhereNode.make_atom(self, child, qn, connection) - # else might be an HSTORE query - return HStoreWhereNode.make_atom(self, child, qn, connection) - - class HStoreGeoQuery(GeoQuery, Query): - def __init__(self, *args, **kwargs): - model = kwargs.pop('model', None) or args[0] - super(HStoreGeoQuery, self).__init__(model, HStoreGeoWhereNode) - - class HStoreGeoQuerySet(HStoreQuerySet, GeoQuerySet): - def __init__(self, model=None, query=None, using=None, **kwargs): - query = query or HStoreGeoQuery(model) - super(HStoreGeoQuerySet, self).__init__(model=model, query=query, using=using, **kwargs) + + if VERSION[:2] <= (1, 7): + from django.contrib.gis.db.models.sql.query import GeoQuery + from django.contrib.gis.db.models.sql.where import GeoWhereNode, GeoConstraint + + class HStoreGeoWhereNode(HStoreWhereNode, GeoWhereNode): + def make_atom(self, child, qn, connection): + lvalue, lookup_type, value_annot, params_or_value = child + # if spatial query + if isinstance(lvalue, GeoConstraint): + return GeoWhereNode.make_atom(self, child, qn, connection) + # else might be an HSTORE query + return HStoreWhereNode.make_atom(self, child, qn, connection) + + class HStoreGeoQuery(GeoQuery, Query): + def __init__(self, *args, **kwargs): + model = kwargs.pop('model', None) or args[0] + super(HStoreGeoQuery, self).__init__(model, HStoreGeoWhereNode) + + class HStoreGeoQuerySet(HStoreQuerySet, GeoQuerySet): + def __init__(self, model=None, query=None, using=None, **kwargs): + query = query or HStoreGeoQuery(model) + super(HStoreGeoQuerySet, self).__init__(model=model, query=query, using=using, **kwargs) + else: + class HStoreGeoQuerySet(HStoreQuerySet, GeoQuerySet): + pass diff --git a/django_hstore/static/admin/js/django_hstore/hstore-widget.js b/django_hstore/static/admin/js/django_hstore/hstore-widget.js old mode 100755 new mode 100644 diff --git a/django_hstore/static/admin/js/django_hstore/underscore-min.js b/django_hstore/static/admin/js/django_hstore/underscore-min.js old mode 100755 new mode 100644 diff --git a/django_hstore/templates/hstore_default_widget.html b/django_hstore/templates/hstore_default_widget.html old mode 100755 new mode 100644 diff --git a/django_hstore/templates/hstore_grappelli_widget.html b/django_hstore/templates/hstore_grappelli_widget.html old mode 100755 new mode 100644 diff --git a/django_hstore/utils.py b/django_hstore/utils.py old mode 100755 new mode 100644 diff --git a/django_hstore/virtual.py b/django_hstore/virtual.py old mode 100755 new mode 100644 index 4dd9b79..a10494a --- a/django_hstore/virtual.py +++ b/django_hstore/virtual.py @@ -14,6 +14,8 @@ class HStoreVirtualMixin(object): """ must be mixed-in with django fields """ + concrete = False + def contribute_to_class(self, cls, name): if self.choices: setattr(cls, 'get_%s_display' % self.name, diff --git a/django_hstore/widgets.py b/django_hstore/widgets.py old mode 100755 new mode 100644 diff --git a/doc/doc.asciidoc b/doc/doc.asciidoc old mode 100755 new mode 100644 index 78aa880..b2a6584 --- a/doc/doc.asciidoc +++ b/doc/doc.asciidoc @@ -111,7 +111,7 @@ Requirements ^^^^^^^^^^^^ - Python 2.6, 2.7 or 3.3+ -- Django 1.5, 1.6 and 1.7 +- Django 1.6, 1.7 and 1.8 - Psycopg2 2.4.3+ - PostgreSQL 9.0+ diff --git a/doc/images/deafult-admin-widget-raw.png b/doc/images/deafult-admin-widget-raw.png old mode 100755 new mode 100644 diff --git a/doc/images/deafult-admin-widget.png b/doc/images/deafult-admin-widget.png old mode 100755 new mode 100644 diff --git a/doc/images/hstore-widget-raw.png b/doc/images/hstore-widget-raw.png old mode 100755 new mode 100644 diff --git a/doc/images/hstore-widget.png b/doc/images/hstore-widget.png old mode 100755 new mode 100644 diff --git a/requirements.txt b/requirements.txt old mode 100755 new mode 100644 diff --git a/setup.cfg b/setup.cfg old mode 100755 new mode 100644 diff --git a/tests/__init__.py b/tests/__init__.py old mode 100755 new mode 100644 diff --git a/tests/django_hstore_tests/admin.py b/tests/django_hstore_tests/admin.py old mode 100755 new mode 100644 diff --git a/tests/django_hstore_tests/models.py b/tests/django_hstore_tests/models.py old mode 100755 new mode 100644 diff --git a/tests/django_hstore_tests/tests.py b/tests/django_hstore_tests/tests.py old mode 100755 new mode 100644 index e9d4a7c..d56b487 --- a/tests/django_hstore_tests/tests.py +++ b/tests/django_hstore_tests/tests.py @@ -428,7 +428,11 @@ def test_bad_default(self): try: m.save() except IntegrityError: - transaction.rollback() + if DJANGO_VERSION[:2] >= (1, 6): + pass + # TODO: remove in future versions of django-hstore + else: + transaction.rollback() else: self.assertTrue(False) @@ -1011,7 +1015,11 @@ def test_bad_default(self): try: m.save() except IntegrityError: - transaction.rollback() + if DJANGO_VERSION[:2] >= (1, 6): + pass + # TODO: remove in future versions of django-hstore + else: + transaction.rollback() else: self.assertTrue(False) @@ -1193,7 +1201,7 @@ def test_str(self): self.assertEqual(str(d.data), '{}') -class SchemaTests(TestCase): +class TestSchemaMode(TestCase): if DJANGO_VERSION[:2] >= (1, 6): @classmethod def tearDownClass(cls): @@ -1464,47 +1472,90 @@ def test_str(self): d = SchemaDataBag() self.assertEqual(str(d.data), '{}') - def test_reload_schema(self): - # cache some stuff - f = SchemaDataBag._meta.get_field('data') - original_schema = list(f.schema) - concrete_fields_length = len(SchemaDataBag._meta.concrete_fields) - hstore_virtual_fields_keys = list(SchemaDataBag._hstore_virtual_fields.keys()) - - # original state - d = SchemaDataBag() - self.assertTrue(d.data.schema_mode) - self.assertEqual(len(SchemaDataBag._meta.virtual_fields), len(original_schema)) - self.assertEqual(len(SchemaDataBag._meta.fields), len(original_schema) + concrete_fields_length) - self.assertEqual(len(SchemaDataBag._meta.local_fields), len(original_schema) + concrete_fields_length) - self.assertTrue(hasattr(SchemaDataBag, '_hstore_virtual_fields')) - for key in hstore_virtual_fields_keys: - self.assertTrue(hasattr(d, key)) - - # schema erased - f.reload_schema(None) - self.assertIsNone(f.schema) - self.assertFalse(f.schema_mode) - self.assertTrue(f.editable) - self.assertEqual(len(SchemaDataBag._meta.virtual_fields), 0) - self.assertEqual(len(SchemaDataBag._meta.fields), concrete_fields_length) - self.assertEqual(len(SchemaDataBag._meta.local_fields), concrete_fields_length) - self.assertFalse(hasattr(SchemaDataBag, '_hstore_virtual_fields')) - d = SchemaDataBag() - self.assertFalse(d.data.schema_mode) - for key in hstore_virtual_fields_keys: - self.assertFalse(hasattr(d, key)) - - # reload original schema - f.reload_schema(original_schema) - d = SchemaDataBag() - self.assertTrue(d.data.schema_mode) - self.assertEqual(len(SchemaDataBag._meta.virtual_fields), len(original_schema)) - self.assertEqual(len(SchemaDataBag._meta.fields), len(original_schema) + concrete_fields_length) - self.assertEqual(len(SchemaDataBag._meta.local_fields), len(original_schema) + concrete_fields_length) - self.assertTrue(hasattr(SchemaDataBag, '_hstore_virtual_fields')) - for key in hstore_virtual_fields_keys: - self.assertTrue(hasattr(d, key)) + if DJANGO_VERSION[:2] >= (1, 8): + def test_reload_schema(self): + # cache some stuff + f = SchemaDataBag._meta.get_field('data') + original_schema = list(f.schema) + local_fields_length = len(SchemaDataBag._meta.local_fields) + hstore_virtual_fields_keys = list(SchemaDataBag._hstore_virtual_fields.keys()) + + # original state + d = SchemaDataBag() + self.assertTrue(d.data.schema_mode) + self.assertEqual(len(SchemaDataBag._meta.virtual_fields), len(original_schema)) + self.assertEqual(len(SchemaDataBag._meta.fields), len(original_schema) + local_fields_length) + #self.assertEqual(len(SchemaDataBag._meta.local_fields), len(original_schema) + local_fields_length) + self.assertTrue(hasattr(SchemaDataBag, '_hstore_virtual_fields')) + for key in hstore_virtual_fields_keys: + self.assertTrue(hasattr(d, key)) + + # schema erased + f.reload_schema(None) + self.assertIsNone(f.schema) + self.assertFalse(f.schema_mode) + self.assertTrue(f.editable) + self.assertEqual(len(SchemaDataBag._meta.virtual_fields), 0) + #self.assertEqual(len(SchemaDataBag._meta.fields), local_fields_length) + #self.assertEqual(len(SchemaDataBag._meta.local_fields), local_fields_length) + #self.assertFalse(hasattr(SchemaDataBag, '_hstore_virtual_fields')) + d = SchemaDataBag() + self.assertFalse(d.data.schema_mode) + for key in hstore_virtual_fields_keys: + self.assertFalse(hasattr(d, key)) + + # reload original schema + f.reload_schema(original_schema) + d = SchemaDataBag() + self.assertTrue(d.data.schema_mode) + #self.assertEqual(len(SchemaDataBag._meta.virtual_fields), len(original_schema)) + #self.assertEqual(len(SchemaDataBag._meta.fields), len(original_schema) + local_fields_length) + #self.assertEqual(len(SchemaDataBag._meta.local_fields), len(original_schema) + local_fields_length) + self.assertTrue(hasattr(SchemaDataBag, '_hstore_virtual_fields')) + for key in hstore_virtual_fields_keys: + self.assertTrue(hasattr(d, key)) + else: + def test_reload_schema(self): + # cache some stuff + f = SchemaDataBag._meta.get_field('data') + original_schema = list(f.schema) + concrete_fields_length = len(SchemaDataBag._meta.concrete_fields) + hstore_virtual_fields_keys = list(SchemaDataBag._hstore_virtual_fields.keys()) + + # original state + d = SchemaDataBag() + self.assertTrue(d.data.schema_mode) + self.assertEqual(len(SchemaDataBag._meta.virtual_fields), len(original_schema)) + self.assertEqual(len(SchemaDataBag._meta.fields), len(original_schema) + concrete_fields_length) + self.assertEqual(len(SchemaDataBag._meta.local_fields), len(original_schema) + concrete_fields_length) + self.assertTrue(hasattr(SchemaDataBag, '_hstore_virtual_fields')) + for key in hstore_virtual_fields_keys: + self.assertTrue(hasattr(d, key)) + + # schema erased + f.reload_schema(None) + self.assertIsNone(f.schema) + self.assertFalse(f.schema_mode) + self.assertTrue(f.editable) + self.assertEqual(len(SchemaDataBag._meta.virtual_fields), 0) + self.assertEqual(len(SchemaDataBag._meta.fields), concrete_fields_length) + self.assertEqual(len(SchemaDataBag._meta.local_fields), concrete_fields_length) + self.assertFalse(hasattr(SchemaDataBag, '_hstore_virtual_fields')) + d = SchemaDataBag() + self.assertFalse(d.data.schema_mode) + for key in hstore_virtual_fields_keys: + self.assertFalse(hasattr(d, key)) + + # reload original schema + f.reload_schema(original_schema) + d = SchemaDataBag() + self.assertTrue(d.data.schema_mode) + self.assertEqual(len(SchemaDataBag._meta.virtual_fields), len(original_schema)) + self.assertEqual(len(SchemaDataBag._meta.fields), len(original_schema) + concrete_fields_length) + self.assertEqual(len(SchemaDataBag._meta.local_fields), len(original_schema) + concrete_fields_length) + self.assertTrue(hasattr(SchemaDataBag, '_hstore_virtual_fields')) + for key in hstore_virtual_fields_keys: + self.assertTrue(hasattr(d, key)) def test_datetime_is_none(self): """ issue #82 https://github.com/djangonauts/django-hstore/issues/82 """ @@ -1568,7 +1619,7 @@ class Migration(migrations.Migration): # start capturing output output = StringIO() sys.stdout = output - call_command('migrate', 'django_hstore_tests') + call_command('migrate', 'django_hstore_tests', fake_initial=True) # stop capturing print statements sys.stdout = sys.__stdout__ self.assertIn('Applying django_hstore_tests.0002_issue_103... OK', output.getvalue()) @@ -1588,12 +1639,17 @@ class SchemaDataBag(models.Model): ]) -class NotTransactionalTests(SimpleTestCase): +class TestNotTransactional(SimpleTestCase): + if DJANGO_VERSION[:2] >= (1, 8): + def setUp(self): + # avoid error "connection already closed" + connection.connect() + if DJANGO_VERSION[:2] >= (1, 6): def test_hstore_registring_in_transaction_block(self): obj1 = DataBag.objects.create(name='alpha1', data={'v': '1', 'v2': '3'}) obj2 = DataBag.objects.create(name='alpha2', data={'v': '1', 'v2': '3'}) - # Close any existing connection previously do anything + # Close any existing connection before doing anything connection.close() with transaction.atomic(): qs = DataBag.objects.filter(name__in=["alpha2", "alpha1"]) @@ -1605,7 +1661,7 @@ def test_hstore_registring_in_transaction_block(self): def test_hstore_registring_in_transaction_block(self): obj1 = DataBag.objects.create(name='alpha1', data={'v': '1', 'v2': '3'}) obj2 = DataBag.objects.create(name='alpha2', data={'v': '1', 'v2': '3'}) - # Close any existing connection previously do anything + # Close any existing connection before doing anything connection.close() with transaction.commit_on_success(): qs = DataBag.objects.filter(name__in=["alpha2", "alpha1"]) @@ -1885,6 +1941,13 @@ def test_location_geomanager(self): d1 = Location.objects.filter(point__distance_lte=(self.pnt1, 70000)) self.assertEqual(d1.count(), 2) + def test_manager(self): + from django_hstore.managers import HStoreGeoManager + isinstance(Location.objects, HStoreGeoManager) + hasattr(Location.objects, 'hpeek') + hasattr(Location.objects, 'hslice') + hasattr(Location.objects, 'hkeys') + # noqa class TestReferencesFieldPlusGIS(TestDictionaryFieldPlusGIS): """ Test ReferenceField with gis backend """ diff --git a/tests/local_settings_psycopg.py.example b/tests/local_settings_psycopg.py.example old mode 100755 new mode 100644 diff --git a/tests/settings.py b/tests/settings.py old mode 100755 new mode 100644 diff --git a/tests/settings_psycopg.py b/tests/settings_psycopg.py old mode 100755 new mode 100644 diff --git a/tests/urls.py b/tests/urls.py old mode 100755 new mode 100644