mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-23 23:12:59 +03:00
Merge pull request #1418 from ze-phyr-us/docs-api-testing-typo-fix
Minor typos fixed in api-guide/testing.md (request -> response).
This commit is contained in:
commit
895d660fdc
|
@ -218,12 +218,12 @@ You can use any of REST framework's test case classes as you would for the regul
|
|||
|
||||
When checking the validity of test responses it's often more convenient to inspect the data that the response was created with, rather than inspecting the fully rendered response.
|
||||
|
||||
For example, it's easier to inspect `request.data`:
|
||||
For example, it's easier to inspect `response.data`:
|
||||
|
||||
response = self.client.get('/users/4/')
|
||||
self.assertEqual(response.data, {'id': 4, 'username': 'lauren'})
|
||||
|
||||
Instead of inspecting the result of parsing `request.content`:
|
||||
Instead of inspecting the result of parsing `response.content`:
|
||||
|
||||
response = self.client.get('/users/4/')
|
||||
self.assertEqual(json.loads(response.content), {'id': 4, 'username': 'lauren'})
|
||||
|
|
Loading…
Reference in New Issue
Block a user