Add linking app setup API views and tests.

This commit is contained in:
Roberto Rosario
2017-02-11 02:12:25 -04:00
parent 3b9bc3fe78
commit 651f659a05
7 changed files with 546 additions and 5 deletions

View File

@@ -13,7 +13,7 @@ from ..permissions import (
)
from .literals import (
TEST_SMART_LINK_DYNAMIC_LABEL, TEST_SMART_LINK_EDITED_LABEL,
TEST_SMART_LINK_DYNAMIC_LABEL, TEST_SMART_LINK_LABEL_EDITED,
TEST_SMART_LINK_LABEL
)
@@ -83,7 +83,7 @@ class SmartLinkViewTestCase(GenericDocumentViewTestCase):
response = self.post(
'linking:smart_link_edit', args=(smart_link.pk,), data={
'label': TEST_SMART_LINK_EDITED_LABEL
'label': TEST_SMART_LINK_LABEL_EDITED
}
)
self.assertEqual(response.status_code, 403)
@@ -101,13 +101,13 @@ class SmartLinkViewTestCase(GenericDocumentViewTestCase):
response = self.post(
'linking:smart_link_edit', args=(smart_link.pk,), data={
'label': TEST_SMART_LINK_EDITED_LABEL
'label': TEST_SMART_LINK_LABEL_EDITED
}, follow=True
)
smart_link = SmartLink.objects.get(pk=smart_link.pk)
self.assertContains(response, text='update', status_code=200)
self.assertEqual(smart_link.label, TEST_SMART_LINK_EDITED_LABEL)
self.assertEqual(smart_link.label, TEST_SMART_LINK_LABEL_EDITED)
def setup_smart_links(self):
smart_link = SmartLink.objects.create(