@@ -59,19 +59,19 @@ docker compose exec -T web python manage.py migrate --noinput
5959Seed demo data.
6060
6161``` bash
62- docker compose exec -T web python manage.py seed_demo_data
62+ docker compose exec -T web python manage.py seed_returnhub_demo
6363```
6464
6565Expected result:
6666
6767``` text
68- Seed complete. Stable return case count: 32
68+ ReturnHub demo seed complete.
6969```
7070
7171Run it again to confirm idempotency.
7272
7373``` bash
74- docker compose exec -T web python manage.py seed_demo_data
74+ docker compose exec -T web python manage.py seed_returnhub_demo
7575```
7676
7777## Verify seeded roles and users
@@ -97,13 +97,13 @@ docker compose exec -T web python manage.py shell -c "from django.contrib.auth i
9797Expected:
9898
9999``` text
100- ['admin', 'customer', 'merchant', 'ops']
100+ ['admin.demo ', 'customer.one ', 'customer.two', ' merchant.one ', 'merchant.two', ' ops.demo ']
101101```
102102
103103Shared local password for the seeded users:
104104
105105``` text
106- password123
106+ ChangeMe123!
107107```
108108
109109Check return-case count.
@@ -261,7 +261,7 @@ Document visibility checks:
261261
262262Authenticate with one of the seeded users and verify the live routes.
263263
264- Create a case as ` customer ` :
264+ Create a case as a seeded customer user such as ` customer.one ` :
265265
266266``` http
267267POST /api/returns/
@@ -338,8 +338,8 @@ Check risk:
338338
339339Expected:
340340
341- - ` ops ` and ` admin ` receive risk payloads
342- - ` customer ` and ` merchant ` receive ` 403 `
341+ - ops and admins receive risk payloads
342+ - customers and merchants receive ` 403 `
343343
344344Check audit export:
345345
@@ -486,7 +486,7 @@ docker compose exec web python manage.py shell -c "import logging; from django.t
486486docker compose exec web python manage.py shell -c "import logging; from django.test import Client; from django.contrib.auth import get_user_model; from returns.models import ReturnCase, CaseNote; logging.getLogger('django.request').disabled = True; User = get_user_model(); client = Client(HTTP_HOST='localhost', raise_request_exception=False); user = User.objects.filter(groups__name__iexact='Ops').first() or User.objects.filter(is_superuser=True).first(); nav_case = ReturnCase.objects.order_by('id').first(); sparse_case = ReturnCase.objects.exclude(pk=nav_case.pk).order_by('id').first() or nav_case; CaseNote.objects.filter(return_case=nav_case).delete(); CaseNote.objects.filter(return_case=sparse_case).delete(); CaseNote.objects.create(return_case=nav_case, author=user, body='Older note for ordering check'); CaseNote.objects.create(return_case=nav_case, author=user, body='Newer note for ordering check'); client.force_login(user); response = client.get(f'/ops/{nav_case.pk}/'); sparse_response = client.get(f'/ops/{sparse_case.pk}/'); content = response.content.decode(); sparse_content = sparse_response.content.decode(); print(f'OPS_CASE_DETAIL_QUICK_NAVIGATION_CHECK={\"Quick navigation\" in content}'); print(f'OPS_ACTION_BAR_WORKFLOW_LINK_CHECK={\"#case-status-panel\" in content}'); print(f'OPS_ACTION_BAR_NOTES_LINK_CHECK={\"#case-notes-panel\" in content}'); print(f'OPS_ACTION_BAR_DOCUMENTS_LINK_CHECK={\"#case-document-table\" in content}'); print(f'OPS_ACTION_BAR_TIMELINE_LINK_CHECK={\"#case-timeline\" in content}'); print(f'OPS_CASE_DETAIL_NOTES_PLACEMENT_CHECK={content.index(\"Workflow state\") < content.index(\"Internal notes\") < content.index(\"Documents\")}'); print(f'OPS_NOTES_ORDERING_RENDER_CHECK={content.index(\"Newer note for ordering check\") < content.index(\"Older note for ordering check\")}'); print(f'OPS_EMPTY_NOTES_CHECK={\"No notes yet\" in sparse_content}')"
487487```
488488
489- ### Day 5 ops surface proof
489+ ### Ops surface proof
490490
491491``` bash
492492docker compose exec web python manage.py shell -c "import logging; from django.test import Client; from django.contrib.auth import get_user_model; from returns.models import ReturnCase; logging.getLogger('django.request').disabled = True; User = get_user_model(); client = Client(HTTP_HOST='localhost', raise_request_exception=False); user = User.objects.filter(groups__name__iexact='Ops').first() or User.objects.filter(is_superuser=True).first(); first_case = ReturnCase.objects.order_by('id').first(); sparse_case = ReturnCase.objects.filter(order_reference='RH-RUNBOOK-SPARSE').first() or first_case; client.force_login(user); queue = client.get('/ops/'); detail = client.get(f'/ops/{first_case.pk}/'); page_two = client.get('/ops/?page=2'); empty = client.get('/ops/?status=closed&priority=high&search=unlikely_runbook_value'); sparse = client.get(f'/ops/{sparse_case.pk}/'); queue_content = queue.content.decode(); detail_content = detail.content.decode(); empty_content = empty.content.decode(); sparse_content = sparse.content.decode(); print(f'OPS_QUEUE_SMOKE_RENDER_CHECK={queue.status_code == 200 and \"Returns queue\" in queue_content}'); print(f'OPS_DETAIL_SMOKE_RENDER_CHECK={detail.status_code == 200 and first_case.order_reference in detail_content}'); print(f'OPS_QUEUE_PAGE_TWO_CHECK={page_two.status_code == 200 and \"Showing 16-\" in page_two.content.decode()}'); print(f'OPS_QUEUE_EMPTY_STATE_CHECK={\"No cases match these filters\" in empty_content}'); print(f'OPS_DETAIL_EMPTY_DOCUMENTS_CHECK={\"No documents yet\" in sparse_content}'); print(f'OPS_DETAIL_EMPTY_TIMELINE_CHECK={\"No timeline events yet\" in sparse_content}'); print(f'OPS_DETAIL_LOADING_LAYER_CHECK={(\"data-loading-label\" in detail_content) and (\"rh-fragment-panel__status\" in detail_content)}'); print(f'OPS_DETAIL_FRAGMENT_IDS_CHECK={(\"case-status-panel\" in detail_content) and (\"case-notes-panel\" in detail_content)}')"
0 commit comments