diff options
Diffstat (limited to 'archaeological_finds/tests.py')
-rw-r--r-- | archaeological_finds/tests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/archaeological_finds/tests.py b/archaeological_finds/tests.py index 18744ea3d..2d1367c58 100644 --- a/archaeological_finds/tests.py +++ b/archaeological_finds/tests.py @@ -20,8 +20,11 @@ import datetime from django.conf import settings +from django.contrib.auth.models import User from django.core.files.uploadedfile import SimpleUploadedFile +from django.core.urlresolvers import reverse from django.test import TestCase +from django.test.client import Client from ishtar_common.models import ImporterType, IshtarUser, ImporterColumn,\ FormaterType, ImportTarget @@ -294,6 +297,11 @@ class FindTest(FindInit, TestCase): def setUp(self): self.create_finds(force=True) + password = 'mypassword' + my_admin = User.objects.create_superuser( + 'myuser', 'myemail@test.com', password) + self.client = Client() + self.client.login(username=my_admin.username, password=password) def testExternalID(self): find = self.finds[0] @@ -309,6 +317,13 @@ class FindTest(FindInit, TestCase): base_find.context_record.external_id, base_find.label)) + def testShowFind(self): + find = self.finds[0] + response = self.client.get(reverse('display-find', args=[find.pk])) + self.assertEqual(response.status_code, 200) + self.assertIn('load_window("/show-find/{}/");'.format(find.pk), + response.content) + class PackagingTest(FindInit, TestCase): fixtures = [settings.ROOT_PATH + |