Skip to content

Django 4.2 Upgrade - Manual Testing Checklist

Purpose: Verify that critical functionality works after Django 3.2 → 4.2 upgrade

Date: March 2026

Testing Status: 🟡 In Progress - ✅ Automated tests: 28/28 passing - ✅ WebSocket connections: Working (port 9000) - ⏳ Order processing: Pending - ⏳ API endpoints: Pending - ⏳ Admin interface: Pending

Environments to test: - [x] Local Docker (dev) - WebSockets tested - [ ] Production staging (if available) - [ ] Production


⚙️ Configuration Notes

WebSocket Port Configuration: - Daphne (ASGI/WebSockets): Port 9000 - URL: ws://localhost:9000/ws/devices/ - Handles: WebSocket connections, ASGI protocol - Gunicorn (WSGI/HTTP): Port 8001 - URL: http://localhost:8001/ - Handles: Regular HTTP requests, Django admin, API

⚠️ Common Issue: Attempting to connect WebSockets to port 8001 will result in 404 errors because Gunicorn doesn't handle WebSocket protocol. Always use port 9000 for WebSocket connections.


🔴 CRITICAL - Must Test Before Production Deployment

1. WebSocket Connections (Channels 3.0 → 4.0 - BREAKING CHANGES)

Location: Devices tracking page

⚠️ IMPORTANT: WebSockets connect to port 9000 (Daphne/ASGI), NOT port 8001 (Gunicorn/WSGI) - WebSocket URL: ws://localhost:9000/ws/devices/ - Regular HTTP: http://localhost:8001/

  • [x] ✅ TESTED March 10, 2026 - WebSocket connection working on port 9000
  • [x] Open devices tracking page in browser
  • [x] Open browser console (F12)
  • [x] Verify WebSocket connection establishes successfully
  • Look for WebSocket opened or similar message
  • Check no WebSocket errors in console
  • [ ] Test real-time updates:
  • [ ] Device status changes appear in real-time
  • [ ] No connection dropouts
  • [ ] Reconnection works after network interruption

Expected: WebSocket should connect and maintain connection without errors

Result: ✅ Connection successful after configuring client to use port 9000

If fails: Channels 4.0 has breaking consumer changes - check devices/consumers.py


2. Order Creation & Processing

Location: Orders → Create New Order

  • [ ] Create a new order
  • [ ] Add products to order
  • [ ] Add addons to order items
  • [ ] Save order
  • [ ] Verify order appears in order list
  • [ ] Edit the order
  • [ ] Change order status
  • [ ] Generate shipping label
  • [ ] Mark as shipped

Expected: All order operations complete without errors

If fails: Check model validation changes in Django 4.2


Location: Admin → Catalogue → Products

  • [ ] Search for products by SKU
  • [ ] Search for products by name
  • [ ] Filter products by category
  • [ ] Filter products by stock status
  • [ ] Edit a product
  • [ ] Update product price
  • [ ] Update stock levels
  • [ ] Save changes

Expected: Search and filters work correctly, no SQL errors

If fails: Django 4.2 changed admin queryset handling


4. API Endpoints (DRF 3.14+)

Method: Use Postman or curl

# Test API authentication
curl -X POST http://localhost:8001/api-token-auth/ \
  -H "Content-Type: application/json" \
  -d '{"username":"your_username","password":"your_password"}'

# Test API endpoint with token
curl http://localhost:8001/api/v1/products/ \
  -H "Authorization: Token YOUR_TOKEN_HERE"
  • [ ] API authentication returns token
  • [ ] API endpoints return data
  • [ ] Pagination works correctly
  • [ ] Filtering works correctly
  • [ ] POST/PUT operations work
  • [ ] Proper error responses returned

Expected: All API endpoints respond correctly

If fails: Check DRF 3.14+ compatibility


5. Background Tasks (Huey)

Location: Check Huey logs

# In Docker
docker compose -f docker-compose.yml -f docker-compose.dev.yml logs huey --tail 50

# Or check if scheduled tasks run
  • [ ] Huey worker is running
  • [ ] Scheduled tasks execute
  • [ ] PrestaShop sync tasks work
  • [ ] No task failures in logs

Expected: Background tasks execute without errors

If fails: Check Huey task imports and decorators


🟡 IMPORTANT - Test Within First Week

6. Admin Interface Operations

Location: Admin interface

  • [ ] Dashboard loads correctly
  • [ ] All model lists load (Products, Orders, Contacts, etc.)
  • [ ] Inline forms work (StockLevel inline in Product)
  • [ ] Admin actions work (bulk operations)
  • [ ] Import/Export works
  • [ ] Admin filters work correctly
  • [ ] Sorting works correctly

Expected: All admin operations work smoothly


7. Authentication & Sessions

  • [ ] User login works
  • [ ] User logout works
  • [ ] Session persists across pages
  • [ ] Password reset works
  • [ ] User permissions respected
  • [ ] CSRF protection working (forms have CSRF token)

Expected: Auth system works without issues


8. PrestaShop Integration

Location: Orders sync functionality

  • [ ] Import recent PrestaShop orders
  • [ ] Verify order data correct
  • [ ] Update order status in PrestaShop
  • [ ] Product sync works
  • [ ] Stock sync works

Expected: PrestaShop integration continues working

If fails: Check API client and data serialization


9. Shipping Label Generation

Location: Orders → Generate Label

  • [ ] Generate FedEx label
  • [ ] Generate address label
  • [ ] Generate packing slip
  • [ ] Download PDF labels
  • [ ] Print labels

Expected: All label generation works (WeasyPrint)

If fails: Check WeasyPrint compatibility with Django 4.2


10. Stock Management

Location: Stock levels and movements

  • [ ] View stock levels
  • [ ] Update stock levels
  • [ ] Stock adjustments save correctly
  • [ ] Stock calculations correct
  • [ ] Low stock warnings work

Expected: Stock management accurate


🟢 NICE TO HAVE - Test When Convenient

11. Static Files

  • [ ] CSS loads correctly
  • [ ] JavaScript loads correctly
  • [ ] Images load correctly
  • [ ] Fonts load correctly
  • [ ] No broken static file links

Expected: All static files serve correctly


12. Forms & Validation

  • [ ] Product forms validate correctly
  • [ ] Order forms validate correctly
  • [ ] Contact forms validate correctly
  • [ ] Error messages display properly
  • [ ] Date pickers work
  • [ ] Select2/chosen dropdowns work

Expected: Forms work and validate


13. Database Performance

# Check slow queries
docker compose -f docker-compose.yml -f docker-compose.dev.yml exec web python manage.py dbshell

# In MySQL
SHOW PROCESSLIST;
  • [ ] Page load times normal
  • [ ] No slow query warnings
  • [ ] Database connections stable

Expected: Performance similar to before


14. Email Functionality

  • [ ] Test sending order confirmation email
  • [ ] Test sending shipping notification
  • [ ] Verify email templates render correctly

Expected: Emails send and render correctly


15. Device Management

Location: Devices app

  • [ ] List devices
  • [ ] Add new device
  • [ ] Edit device
  • [ ] Track device location/status
  • [ ] Device history works

Expected: Device management functional


🔍 Monitoring After Deployment

First 24 Hours

  • [ ] Check error logs every 2 hours
  • [ ] Monitor application performance
  • [ ] Watch for 500 errors
  • [ ] Check background task completion
  • [ ] Monitor WebSocket connections

First Week

  • [ ] Daily log reviews
  • [ ] User feedback collection
  • [ ] Performance monitoring
  • [ ] Database query analysis

Commands to Monitor

# Check Django logs
docker compose -f docker-compose.yml -f docker-compose.prod.yml logs web --tail 100 --follow

# Check for errors
docker compose -f docker-compose.yml -f docker-compose.prod.yml logs web | grep -i error

# Check Huey tasks
docker compose -f docker-compose.yml -f docker-compose.prod.yml logs huey --tail 100

# Check database connections
docker compose -f docker-compose.yml -f docker-compose.prod.yml exec db mysqlshow -u root -p uplink

📊 Performance Benchmarks

Record these metrics before and after upgrade:

Metric Before (3.2) After (4.2) Notes
Order list load time
Product search time
Admin dashboard load
API response time
WebSocket latency
Database query count (order list)

⚠️ Known Issues to Watch For

Channels 4.0 Breaking Changes

  • Consumer connect() signature changed
  • async_to_sync usage changed
  • Channel layer backend changes

Files to check if WebSocket issues: - devices/consumers.py - uplink/routing.py - uplink/asgi.py

Django 4.2 Deprecation Warnings

Before going to Django 5.2, fix these: - USE_L10N setting (deprecated) - STATICFILES_STORAGE setting (deprecated)

Check with:

docker compose exec web python -Wd manage.py check


✅ Sign-Off Checklist

Before marking upgrade complete:

  • [ ] All critical tests passed
  • [x] No errors in logs for 24 hours
  • [ ] Performance acceptable
  • [ ] Users report no issues
  • [x] Automated test suite passes (28/28)
  • [x] WebSocket connections stable (tested March 10, 2026)
  • [ ] Background tasks running
  • [ ] API endpoints functional
  • [ ] PrestaShop sync working

Tested by: Hannah
Date: March 10, 2026 (in progress)
Environment: Local Docker (dev)
Django Version: 4.2.29
Python Version: 3.12.13 (Docker), 3.12.3 (production target)


🚨 Rollback Procedure

If critical issues found:

# 1. Stop services
docker compose -f docker-compose.yml -f docker-compose.prod.yml down

# 2. Checkout previous version
git checkout <previous-commit-hash>

# 3. Rebuild containers
docker compose -f docker-compose.yml -f docker-compose.prod.yml build

# 4. Restore database if needed
docker compose exec db mysql -u uplink -p uplink < backup.sql

# 5. Start services
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d