make_post_sell/CLAUDE.md

2.4 KiB

Claude Development Notes

Project Setup

This project uses a Makefile for most development operations. Use make commands instead of running tools directly.

Common Development Tasks

Testing

  • Run tests: make test
    • This installs development dependencies and runs the test suite with py.test
    • Tests are located in make_post_sell/tests/

Installation & Setup

  • Install from source for development: make install-from-source
  • Install from PyPI: make install-from-pypi
  • Initialize database: make init-db

Development Server

  • Start development server: make serve
    • Runs with auto-reload enabled
    • Uses data/development.ini configuration

Environment Management

  • Create virtual environment: make venv
  • Clean up environment: make clean
  • Activate environment: source env/bin/activate

Code Structure

Key Directories

  • make_post_sell/views/ - View controllers
  • make_post_sell/models/ - Database models
  • make_post_sell/tests/ - Test suite

Important Files

  • make_post_sell/views/cart.py - Cart and checkout logic
  • development.ini - Configuration file

Testing Notes

The project uses pytest with unittest framework. There are three types of tests:

Test Types

  • Unit tests (test_models.py) - Test individual model methods and properties in isolation
  • Integration tests (test_integration.py) - Test interactions between models and business logic
  • Functional tests (test_functional.py) - End-to-end tests through the web interface

Running Tests

Before running tests: Source environment variables with source vars.sh to set required Stripe API keys and other configuration.

# Run all tests
make test

# Run specific test types
env/bin/py.test make_post_sell/tests/test_models.py     # Unit tests
env/bin/py.test make_post_sell/tests/test_integration.py # Integration tests  
env/bin/py.test make_post_sell/tests/test_functional.py  # Functional tests

# Run with coverage
env/bin/py.test --cov=make_post_sell.models.cart --cov-report=term-missing make_post_sell/tests/test_models.py::TestCart

Current Coverage

  • Cart model unit tests cover critical business logic like requires_payment threshold (64 cents)
  • Integration tests verify the original AttributeError bug fix for free coupon checkout
  • Functional tests provide end-to-end coverage of cart/checkout/payment flows

Commit Message Guidelines

Do not include Claude Code attribution in commit messages.