settings_fixture.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import pytest
  2. from flaskbb.utils.forms import SettingValueType
  3. @pytest.fixture
  4. def updated_fixture():
  5. return (
  6. # a group where we change a lot
  7. ('general', {
  8. 'name': "General Settings",
  9. 'description': "This description is wrong.",
  10. 'settings': (
  11. # change value
  12. ('project_title', {
  13. 'value': "FlaskBB is cool!",
  14. 'value_type': SettingValueType.string,
  15. 'name': "Project title",
  16. 'description': "The title of the project.",
  17. }),
  18. # add
  19. ('test_fixture', {
  20. 'description': 'This is a test fixture',
  21. 'name': 'Test Fixture',
  22. 'value': 'FlaskBBTest',
  23. 'value_type': SettingValueType.string
  24. }),
  25. )
  26. }),
  27. # a group where we change nothing
  28. ('auth', {
  29. 'name': 'Authentication Settings',
  30. 'description': 'Settings for the Login and Register process.',
  31. # the same as in flaskbb/settings/fixtures/settings.py
  32. 'settings': (
  33. ('registration_enabled', {
  34. 'value': True,
  35. 'value_type': SettingValueType.boolean,
  36. 'name': "Enable Registration",
  37. 'description': "Enable or disable the registration",
  38. }),
  39. )
  40. }),
  41. # a wholly new group
  42. ('testgroup', {
  43. 'name': "Important settings",
  44. 'description': "Some settings without the world would not work.",
  45. 'settings': (
  46. # change value
  47. ('monty_python', {
  48. 'value': "And now for something completely different...",
  49. 'value_type': SettingValueType.string,
  50. 'name': "Monty Python",
  51. 'description': "A random quote from Monty Python.",
  52. }),
  53. )
  54. })
  55. )