repo_description: 接口自动化测试平台,基于HttpRunner+Python+Django+Vue,已在多家公司落地使用,2018年服役至今
repo_topics: auto auto-test automation autotest autotesting django fasterrunner httprunner pytho python python-test test-automation
code: # Test settings for FasterRunner
  import datetime
  
  from FasterRunner.settings.base import *
  
  # Test database configuration
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': ':memory:',
      }
  }
  
  # Disable external services for testing
  CELERY_TASK_ALWAYS_EAGER = True
  CELERY_TASK_EAGER_PROPAGATES = True
  
  # Use in-memory cache for tests
  CACHES = {
      'default': {
          'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
      }
  }
  
  # Test logging
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'handlers': {
          'console': {
              'class': 'logging.StreamHandler',
          },
      },
      'root': {
          'handlers': ['console'],
          'level': 'WARNING',
      },
  }
  
  # Security settings for tests
  SECRET_KEY = 'django-insecure-test-key-not-for-production-use-only'
  DEBUG = False
  ALLOWED_HOSTS = ['*']
  
  # Disable external integrations
  USE_LDAP = False
  
  # Test JWT settings
  JWT_AUTH = {
      'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=300),
      'JWT_AUTH_HEADER_PREFIX': 'Token',
  }
  
  # Disable migration running in tests
  class DisableMigrations:
      def __contains__(self, item):
          return True
  
      def __getitem__(self, item):
          return None
  
  MIGRATION_MODULES = DisableMigrations()
  
  # Test settings
  TEST_RUNNER = 'django.test.runner.DiscoverRunner'