settings_fixture.py 1.9 KB

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