﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24680	In testing, warnings appear when loading database-specific fixtures	Zhongyuan	nobody	"'''How to reproduce'''

settings.py:

{{{
DATABASES = {
    'db1': {......},
    'db2': {......}
}
}}}

fixtures:
fixtures/data1.db1.json
fixtures/data2.db2.json

tests.py:

{{{
class FixtureTestCase(TestCase):
    fixtures = ['data1', 'data2']
    multi_db = True

    def test(self): pass
}}}

'''Expected results'''
As stated in the doc [https://docs.djangoproject.com/en/dev/ref/django-admin/#database-specific-fixtures], ""data1"" should be loaded into ""db1"" DB, ""data2"" should be loaded into ""db2"". 

'''Real results'''
Fixtures were loaded correctly. But there were warnings appeared: ""UserWarning: No fixture named 'data1' found.""; ""UserWarning: No fixture named 'data2' found.""

As everything was set up as required, warnings should not appear

'''How it happened'''
""TestCase._fixture_setup"" call ""loaddata"" command on all database-fixture combinations, like this:

{{{
loaddata data1 data2 database=db1
loaddata data1 data2 database=db2
}}}

For ""db1"", ""data2"" is not found; and for ""db2"", ""data1"" is not found. So warnings raised.

I think the implementation of ""_fixture_setup"" and/or ""loaddata"" need some change, to make it work perfectly"	Cleanup/optimization	closed	Core (Management commands)	dev	Normal	duplicate	testing, fixtures, database-specific, warning		Accepted	0	0	0	0	0	0
