Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
3a0d54c7
Commit
3a0d54c7
authored
Aug 28, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix testing example. Closes #3346
parent
82642224
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
docs/api-guide/testing.md
+3
-1
No files found.
docs/api-guide/testing.md
View file @
3a0d54c7
...
@@ -200,6 +200,7 @@ You can use any of REST framework's test case classes as you would for the regul
...
@@ -200,6 +200,7 @@ You can use any of REST framework's test case classes as you would for the regul
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.test import APITestCase
from myproject.apps.core.models import Account
class AccountTests(APITestCase):
class AccountTests(APITestCase):
def test_create_account(self):
def test_create_account(self):
...
@@ -210,7 +211,8 @@ You can use any of REST framework's test case classes as you would for the regul
...
@@ -210,7 +211,8 @@ You can use any of REST framework's test case classes as you would for the regul
data = {'name': 'DabApps'}
data = {'name': 'DabApps'}
response = self.client.post(url, data, format='json')
response = self.client.post(url, data, format='json')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(response.data, data)
self.assertEqual(Account.objects.count(), 1)
self.assertEqual(Account.objects.get().name, 'DabApps')
---
---
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment