* has_patch: 0 => 1
* ui_ux: => 0
* easy: => 0
Comment:
test_db_signature in db/backends/[oracle/]creation.py was not using
TEST_NAME. Diff attached that gives precedence to TEST_NAME, then NAME
--
Ticket URL: <https://code.djangoproject.com/ticket/15691#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by jwpeddle):
Replying to [comment:5 anonymous]:
> test_db_signature in db/backends/[oracle/]creation.py was not using
TEST_NAME. Diff attached that gives precedence to TEST_NAME, then NAME
Forgot to sign my name.
--
Ticket URL: <https://code.djangoproject.com/ticket/15691#comment:6>
* needs_tests: 0 => 1
Comment:
This needs a test.
--
Ticket URL: <https://code.djangoproject.com/ticket/15691#comment:8>
* status: new => closed
* resolution: => worksforme
Comment:
This doesn't reproduce for me on latest `main`.
These settings:
{{{
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'TEST': {
'NAME': BASE_DIR / 'test_mydb',
'DEPENDENCIES': ['users'],
},
},
'users': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'TEST': {
'NAME': BASE_DIR / 'test_users',
'DEPENDENCIES': [],
},
},
}
}}}
This model:
{{{
from django.db import models
class DefaultModel(models.Model):
name = models.TextField()
}}}
This test:
{{{
from django.test import TestCase
from .models import DefaultModel
class TheTests(TestCase):
databases = '__all__'
def test_basics(self):
o = DefaultModel(name="Default")
o.save()
o = DefaultModel(name="Users")
o.save(using="users")
d = DefaultModel.objects.get()
u = DefaultModel.objects.using('users').get()
self.assertEqual(d, u)
self.assertNotEqual(d.name, u.name)
}}}
All runs without error.
I'll upload the project zip in case someone wants to play with it.
> ...checks for circular dependencies by looking at the NAME key, ignoring
TEST_NAME if it exists...
This doesn't look right, at least how the code is now. The check compared
aliases, not `NAME` or `TEST['NAME']`.
I'll close as `worksforme` but happy to re-open if someone can provide a
reproduce.
--
Ticket URL: <https://code.djangoproject.com/ticket/15691#comment:9>
* Attachment "issue15691.zip" added.
Test project trying to reproduce circa 2022.
--
Ticket URL: <https://code.djangoproject.com/ticket/15691>