Finish conversion of the folders app to organizations.
This commit is contained in:
@@ -37,40 +37,40 @@ class FolderAPITestCase(APITestCase):
|
||||
reverse('rest_api:folder-list'), {'label': TEST_FOLDER_LABEL}
|
||||
)
|
||||
|
||||
folder = Folder.objects.first()
|
||||
folder = Folder.on_organization.first()
|
||||
|
||||
self.assertEqual(response.data['id'], folder.pk)
|
||||
self.assertEqual(response.data['label'], TEST_FOLDER_LABEL)
|
||||
|
||||
self.assertEqual(Folder.objects.count(), 1)
|
||||
self.assertEqual(Folder.on_organization.count(), 1)
|
||||
self.assertEqual(folder.label, TEST_FOLDER_LABEL)
|
||||
|
||||
def test_folder_delete(self):
|
||||
folder = Folder.objects.create(label=TEST_FOLDER_LABEL)
|
||||
folder = Folder.on_organization.create(label=TEST_FOLDER_LABEL)
|
||||
|
||||
self.client.delete(
|
||||
reverse('rest_api:folder-detail', args=(folder.pk,))
|
||||
)
|
||||
|
||||
self.assertEqual(Folder.objects.count(), 0)
|
||||
self.assertEqual(Folder.on_organization.count(), 0)
|
||||
|
||||
def test_folder_edit(self):
|
||||
folder = Folder.objects.create(label=TEST_FOLDER_LABEL)
|
||||
folder = Folder.on_organization.create(label=TEST_FOLDER_LABEL)
|
||||
|
||||
self.client.put(
|
||||
reverse('rest_api:folder-detail', args=(folder.pk,)),
|
||||
{'label': TEST_FOLDER_EDITED_LABEL}
|
||||
)
|
||||
|
||||
folder = Folder.objects.first()
|
||||
folder = Folder.on_organization.first()
|
||||
|
||||
self.assertEqual(folder.label, TEST_FOLDER_EDITED_LABEL)
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
def test_folder_add_document(self):
|
||||
folder = Folder.objects.create(label=TEST_FOLDER_LABEL)
|
||||
folder = Folder.on_organization.create(label=TEST_FOLDER_LABEL)
|
||||
|
||||
document_type = DocumentType.objects.create(
|
||||
document_type = DocumentType.on_organization.create(
|
||||
label=TEST_DOCUMENT_TYPE
|
||||
)
|
||||
|
||||
@@ -88,9 +88,9 @@ class FolderAPITestCase(APITestCase):
|
||||
|
||||
@override_settings(OCR_AUTO_OCR=False)
|
||||
def test_folder_remove_document(self):
|
||||
folder = Folder.objects.create(label=TEST_FOLDER_LABEL)
|
||||
folder = Folder.on_organization.create(label=TEST_FOLDER_LABEL)
|
||||
|
||||
document_type = DocumentType.objects.create(
|
||||
document_type = DocumentType.on_organization.create(
|
||||
label=TEST_DOCUMENT_TYPE
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user