Fix document app tests.
This commit is contained in:
@@ -4,16 +4,13 @@ from __future__ import unicode_literals
|
||||
|
||||
import time
|
||||
|
||||
from json import loads
|
||||
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.test import override_settings
|
||||
from django.utils.six import BytesIO
|
||||
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from rest_api.tests.base import GenericAPITestCase
|
||||
from rest_api.tests import GenericAPITestCase
|
||||
from user_management.tests.literals import (
|
||||
TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME
|
||||
)
|
||||
@@ -113,7 +110,7 @@ class DocumentAPITestCase(GenericAPITestCase):
|
||||
}
|
||||
)
|
||||
|
||||
document_data = loads(response.content)
|
||||
document_data = response.data
|
||||
|
||||
self.assertEqual(
|
||||
response.status_code, status.HTTP_201_CREATED
|
||||
|
||||
@@ -832,7 +832,7 @@ class TrashedDocumentTestCase(GenericDocumentViewTestCase):
|
||||
username=TEST_USER_USERNAME, password=TEST_USER_PASSWORD
|
||||
)
|
||||
|
||||
response = self.get('documents:document_list_deleted')
|
||||
response = self.get('documents:document_list_trashed')
|
||||
|
||||
self.assertNotContains(response, self.document.label, status_code=200)
|
||||
|
||||
@@ -846,6 +846,6 @@ class TrashedDocumentTestCase(GenericDocumentViewTestCase):
|
||||
self.role.permissions.add(
|
||||
permission_document_view.stored_permission
|
||||
)
|
||||
response = self.get('documents:document_list_deleted')
|
||||
response = self.get('documents:document_list_trashed')
|
||||
|
||||
self.assertContains(response, self.document.label, status_code=200)
|
||||
|
||||
@@ -608,7 +608,7 @@ class DocumentView(SingleObjectDetailView):
|
||||
|
||||
class EmptyTrashCanView(ConfirmView):
|
||||
action_cancel_redirect = post_action_redirect = reverse_lazy(
|
||||
'documents:document_list_deleted'
|
||||
'documents:document_list_trashed'
|
||||
)
|
||||
extra_context = {
|
||||
'title': _('Empty trash?')
|
||||
|
||||
Reference in New Issue
Block a user