Skip to content

Conversation

@Rish-it
Copy link

@Rish-it Rish-it commented Apr 8, 2025

Wagtail Bakery Demo Test Suite

This test suite demonstrates testing best practices for Wagtail applications through the Bakery Demo project. It provides comprehensive coverage of core Wagtail features and common implementation patterns.

Test Coverage

1. Page Models and Content Management

  • HomePage

    • Page creation and hierarchy
    • Content management and rendering
    • Template integration
    • Child page relationships
  • Blog Pages

    • Blog index page setup
    • Post creation and management
    • Author attribution
    • Publishing workflow

2. Form Handling

  • Contact Form
    • Form validation
    • Required/optional fields
    • Data processing
    • Submission handling

3. StreamField Blocks

  • Content Blocks
    • Rich text blocks
    • Call-to-action blocks
    • Image gallery blocks
    • Testimonial blocks
    • Block validation and rendering

4. Blog Features

  • Blog Index

    • Post listing and pagination
    • Category and tag filtering
    • Search functionality
    • Archive pages
  • Taxonomy

    • Category management
    • Tag handling
    • Post categorization
    • Tag cloud functionality

Testing Best Practices

This test suite demonstrates:

  • Proper test organization and structure
  • Comprehensive coverage of Wagtail features
  • Clear test descriptions and documentation
  • Effective use of Wagtail's test utilities
  • Testing of complex Wagtail components

Running Tests

# Run all tests
python manage.py test

# Run specific test modules
python manage.py test bakerydemo.base.tests
python manage.py test bakerydemo.blog.tests

# Run with coverage report
coverage run --source='.' manage.py test
coverage report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant