testing.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. """
  2. flaskbb.configs.testing
  3. ~~~~~~~~~~~~~~~~~~~~
  4. This is the FlaskBB's testing config.
  5. :copyright: (c) 2014 by the FlaskBB Team.
  6. :license: BSD, see LICENSE for more details.
  7. """
  8. from flaskbb.configs.default import DefaultConfig
  9. class TestingConfig(DefaultConfig):
  10. # Indicates that it is a testing environment
  11. DEBUG = False
  12. TESTING = True
  13. SQLALCHEMY_DATABASE_URI = (
  14. 'sqlite://'
  15. )
  16. SERVER_NAME = "localhost:5000"
  17. # This will print all SQL statements
  18. SQLALCHEMY_ECHO = False
  19. # Use the in-memory storage
  20. WHOOSHEE_MEMORY_STORAGE = True
  21. CELERY_CONFIG = {
  22. "always_eager": True,
  23. "eager_propagates_exceptions": True,
  24. "result_backend": "cache",
  25. "cache_backend": "memory",
  26. }
  27. LOG_DEFAULT_CONF = {
  28. 'version': 1,
  29. 'disable_existing_loggers': False,
  30. 'formatters': {
  31. 'standard': {
  32. 'format': '%(asctime)s %(levelname)-7s %(name)-25s %(message)s'
  33. },
  34. },
  35. 'handlers': {
  36. 'console': {
  37. 'level': 'NOTSET',
  38. 'formatter': 'standard',
  39. 'class': 'logging.StreamHandler',
  40. },
  41. },
  42. # TESTING: Log to console only
  43. 'loggers': {
  44. 'flask.app': {
  45. 'handlers': ['console'],
  46. 'level': 'INFO',
  47. 'propagate': False
  48. },
  49. 'flaskbb': {
  50. 'handlers': ['console'],
  51. 'level': 'WARNING',
  52. 'propagate': False
  53. },
  54. }
  55. }