Add writable versions of the Document and Document Type serializers (GitLab issues #348 and #349).

This commit is contained in:
Roberto Rosario
2017-02-12 03:11:24 -04:00
parent a3959aaf79
commit 92ac4dc2f7
4 changed files with 99 additions and 9 deletions

View File

@@ -49,12 +49,13 @@ class DocumentTypeAPITestCase(APITestCase):
def test_document_type_create(self):
self.assertEqual(DocumentType.objects.all().count(), 0)
self.client.post(
response = self.client.post(
reverse('rest_api:documenttype-list'), data={
'label': TEST_DOCUMENT_TYPE
}
)
self.assertEqual(response.status_code, 201)
self.assertEqual(DocumentType.objects.all().count(), 1)
self.assertEqual(
DocumentType.objects.all().first().label, TEST_DOCUMENT_TYPE