Ticket #17954: setup_databases.patch

File setup_databases.patch, 1019 bytes (added by simonpercivall, 2 years ago)

fix dependency problem when one db is an alias for 'default'

  • django/test/simple.py

    diff --git a/django/test/simple.py b/django/test/simple.py
    index 8faf1e4..c1ae3a1 100644
    a b class DjangoTestSuiteRunner(object): 
    274274        mirrored_aliases = {}
    275275        test_databases = {}
    276276        dependencies = {}
     277        default_sig = connections[DEFAULT_DB_ALIAS].creation.test_db_signature()
    277278        for alias in connections:
    278279            connection = connections[alias]
    279280            if connection.settings_dict['TEST_MIRROR']:
    class DjangoTestSuiteRunner(object): 
    295296                    dependencies[alias] = (
    296297                        connection.settings_dict['TEST_DEPENDENCIES'])
    297298                else:
    298                     if alias != DEFAULT_DB_ALIAS:
     299                    if alias != DEFAULT_DB_ALIAS and not connection.creation.test_db_signature() == default_sig:
    299300                        dependencies[alias] = connection.settings_dict.get(
    300301                            'TEST_DEPENDENCIES', [DEFAULT_DB_ALIAS])
    301302
Back to Top