Skip to content

Commit 89d2294

Browse files
Add missing docs on RequestsClient. Closes encode#4747.
1 parent 7ecd4f7 commit 89d2294

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/api-guide/testing.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ Note that the requests client requires you to pass fully qualified URLs.
205205

206206
## `RequestsClient` and working with the database
207207

208-
The `RequestsClient` class is useful if
208+
The `RequestsClient` class is useful if you want to write tests that solely interact with the service interface. This is a little stricter than using the standard Django test client, as it means that all interactions should be via the API.
209+
210+
If you're using `RequestsClient` you'll want to ensure that test setup, and results assertions are performed as regular API calls, rather than interacting with the database models directly. For example, rather than checking that `Customer.objects.count() == 3` you would list the customers endpoint, and ensure that it contains three records.
209211

210212
## Headers & Authentication
211213

0 commit comments

Comments
 (0)