https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/south/management/commands/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/south/management/commands/__init__.py
# Common framework for syncdb actions

import copy

from django.core import management
from django.conf import settings

# Make sure the template loader cache is fixed _now_ (#448)
import django.template.loaders.app_directories

from south.hacks import hacks
from south.management.commands.syncdb import Command as SyncCommand

class MigrateAndSyncCommand(SyncCommand):
    """Used for situations where "syncdb" is called by test frameworks."""

    option_list = copy.deepcopy(SyncCommand.option_list)

    for opt in option_list:
        if "--migrate" == opt.get_opt_string():
            opt.default = True
            break

def patch_for_test_db_setup():
    # Load the commands cache
    management.get_commands()
    # Repoint to the correct version of syncdb
    if hasattr(settings, "SOUTH_TESTS_MIGRATE") and not settings.SOUTH_TESTS_MIGRATE:
        # point at the core syncdb command when creating tests
        # tests should always be up to date with the most recent model structure
        management._commands['syncdb'] = 'django.core'
    else:
        management._commands['syncdb'] = MigrateAndSyncCommand()
        # Avoid flushing data migrations.
        # http://code.djangoproject.com/ticket/14661 introduced change that flushed custom
        # sql during the test database creation (thus flushing the data migrations).
        # we patch flush to be no-op during create_test_db, but still allow flushing
        # after each test for non-transactional backends.
        hacks.patch_flush_during_test_db_creation()

https://t.me/AnonymousX5 - 2025