test_settings.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. from .settings import * # pylint: disable-all
  2. # Use in-memory cache
  3. CACHES = {"default": {"BACKEND": "django.core.cache.backends.dummy.DummyCache"}}
  4. # Disable Debug Toolbar
  5. DEBUG_TOOLBAR_CONFIG = {}
  6. INTERNAL_IPS = []
  7. # Disable account validation via Stop Forum Spam
  8. MISAGO_NEW_REGISTRATIONS_VALIDATORS = ("misago.users.validators.validate_gmail_email",)
  9. # Store mails in memory
  10. EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
  11. # Use MD5 password hashing to speed up test suite
  12. PASSWORD_HASHERS = ("django.contrib.auth.hashers.MD5PasswordHasher",)
  13. # Simplify password validation to ease writing test assertions
  14. AUTH_PASSWORD_VALIDATORS = [
  15. {
  16. "NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
  17. "OPTIONS": {"user_attributes": ["username", "email"]},
  18. },
  19. {
  20. "NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
  21. "OPTIONS": {"min_length": 7},
  22. },
  23. {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
  24. ]
  25. # Use english search config
  26. MISAGO_SEARCH_CONFIG = "english"
  27. # Register test post validator
  28. MISAGO_POST_VALIDATORS = ["misago.core.testproject.validators.test_post_validator"]
  29. # Register test post search filter
  30. MISAGO_POST_SEARCH_FILTERS = ["misago.core.testproject.searchfilters.test_filter"]
  31. # Default test name
  32. TEST_NAME = "miasago_test"