From 7ae09175648df7f1fa6aad33bda42876d9ff3264 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Wed, 8 Jun 2016 02:02:25 -0400 Subject: [PATCH] Fix document app tests. --- mayan/apps/documents/tests/test_api.py | 7 ++----- mayan/apps/documents/tests/test_views.py | 4 ++-- mayan/apps/documents/views.py | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mayan/apps/documents/tests/test_api.py b/mayan/apps/documents/tests/test_api.py index 79a7de09bf..216f7b7bf8 100644 --- a/mayan/apps/documents/tests/test_api.py +++ b/mayan/apps/documents/tests/test_api.py @@ -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 diff --git a/mayan/apps/documents/tests/test_views.py b/mayan/apps/documents/tests/test_views.py index 8d52c76c48..2ba41f804f 100644 --- a/mayan/apps/documents/tests/test_views.py +++ b/mayan/apps/documents/tests/test_views.py @@ -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) diff --git a/mayan/apps/documents/views.py b/mayan/apps/documents/views.py index 726f40be72..d059c4227c 100644 --- a/mayan/apps/documents/views.py +++ b/mayan/apps/documents/views.py @@ -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?')