[Django] #29223: Dummy database backend may not informs as usable

9 views
Skip to first unread message

Django

unread,
Mar 15, 2018, 8:59:07 AM3/15/18
to django-...@googlegroups.com
#29223: Dummy database backend may not informs as usable
-----------------------------------------+------------------------
Reporter: Wagner Macedo | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 2.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
As far as I understood, the dummy database backend in
`django.db.backends.dummy` is used when we set an empty dictionary in
`DATABASES` setting, depicting a not usable database.

So, maybe it's a mistake this backend returns (always) that is usable:

{{{
def is_usable(self):
return True
}}}

This code can be seen in the repository
[[https://github.com/django/django/blob/60e52a047e55bc4cd5a93a8bd4d07baed27e9a22/django/db/backends/dummy/base.py#L72-L73|here]].

--
Ticket URL: <https://code.djangoproject.com/ticket/29223>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 15, 2018, 11:05:17 AM3/15/18
to django-...@googlegroups.com
#29223: Dummy database backend's is_usable() method should return False
-------------------------------------+-------------------------------------

Reporter: Wagner Macedo | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* component: Uncategorized => Database layer (models, ORM)
* type: Uncategorized => Bug


Comment:

That method was added in 25ce177e66fb0e88a39806f5a493e03f1801775a. Looking
at Django's current usage if `is_usable()`, I don't think changing it for
the dummy backend will have any effect. Is your report mostly theoretical?

--
Ticket URL: <https://code.djangoproject.com/ticket/29223#comment:1>

Django

unread,
Mar 19, 2018, 8:56:23 AM3/19/18
to django-...@googlegroups.com
#29223: Dummy database backend's is_usable() method should return False
-------------------------------------+-------------------------------------
Reporter: Wagner Macedo | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 2.0
(models, ORM) |
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => needsinfo


--
Ticket URL: <https://code.djangoproject.com/ticket/29223#comment:2>

Reply all
Reply to author
Forward
0 new messages