#25400: Attributes are always set on `connection.features` (gis)
----------------------------------------------+------------------------
Reporter: blueyed | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords: regression
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+------------------------
With commit d9ff5ef36d3f714736d633435d45f03eac9c17b5 the behaviour of
`hasattr`
on `connection.features` seems to have changed, e.g. the following will be
True
now always, and was previously so only for Django < 1.5.
{{{
hasattr(connection.features, 'confirm')
}}}
pytest-django is using the following code:
{{{
# confirm() is not needed/available in Django >= 1.5
# See https://code.djangoproject.com/ticket/17760
if hasattr(self.connection.features, 'confirm'):
self.connection.features.confirm()
}}}
The problem seems to be that `__getattr__` should raise an AttributeError
in this case.
(Source:
https://github.com/django/django/commit/d9ff5ef36d3f714736d633435d45f03eac9c17b5
#diff-fbce17c4cb97f431da78cbdf3ac4ff16R90)
--
Ticket URL: <https://code.djangoproject.com/ticket/25400>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.662055f4a9f429617fd282da27d6332c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.