CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/django-testing

Write correct Django tests — TestCase vs TransactionTestCase, setUpTestData, factory-boy, assertNumQueries, mock.patch placement, and DRF APITestCase patterns

99

1.33x
Quality

99%

Does it follow best practices?

Impact

99%

1.33x

Average score across 2 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

Evaluation results

98%

32%

Blog API Tests

Criteria
Without context
With context

setUpTestData for read-only fixtures

0%

87%

assertNumQueries on list endpoints

0%

100%

factory_boy factories defined

100%

100%

Factories used instead of objects.create

100%

100%

TestCase as default base class

100%

100%

Happy path and error tests present

100%

100%

content_type on POST/PUT requests

100%

100%

Authentication tests

100%

100%

No manual tearDown

100%

100%

setUp only for mutable data

50%

100%

100%

17%

E-commerce Checkout Tests

Criteria
Without context
With context

TransactionTestCase for on_commit email test

25%

100%

TestCase for non-commit tests

100%

100%

mock.patch targets orders.views.charge_card

100%

100%

mock.patch targets orders.views.send_order_confirmation

100%

100%

override_settings for MAX_CART_ITEMS

100%

100%

factory_boy factories for test data

50%

100%

Both success and failure payment paths tested

100%

100%

Order status and payment record verified

100%

100%

Authentication required test

100%

100%

No manual tearDown

100%

100%

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents