Modern QA2026UPDATE: Modifying Test State — tiles
Log inJoin
19 / 65 · 15 SQL & Database Testing · Data Manipulation← prev⊞ allnext →☰ Read as one page

3.3UPDATE: Modifying Test State

-- Set a user's password to expired (test expired password flow)
UPDATE users
SET password_expires_at = NOW() - INTERVAL '1 day'
WHERE email = 'testuser@automation.com';

-- Set an order to a specific status (test status-dependent logic)
UPDATE orders
SET status = 'shipped', shipped_at = NOW() - INTERVAL '2 hours'
WHERE id = 'order-001';

-- Simulate a user who has been inactive for 6 months
UPDATE users
SET last_login_at = NOW() - INTERVAL '6 months'
WHERE email = 'testuser@automation.com';