summaryrefslogtreecommitdiff
path: root/archaeological_files/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-05 02:34:49 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-07-05 02:34:49 +0200
commit923b2533d62454f89b409628ab0203c3641e30ed (patch)
tree3d9ad77c1c38881bbe5344282b829090771468d4 /archaeological_files/tests.py
parent31cef7ca152ddc6a9f27b0f9db5932a08f7d7082 (diff)
downloadIshtar-923b2533d62454f89b409628ab0203c3641e30ed.tar.bz2
Ishtar-923b2533d62454f89b409628ab0203c3641e30ed.zip
Town/Parcel form: fix modification (refs #3642, refs #3640)
Diffstat (limited to 'archaeological_files/tests.py')
-rw-r--r--archaeological_files/tests.py39
1 files changed, 2 insertions, 37 deletions
diff --git a/archaeological_files/tests.py b/archaeological_files/tests.py
index 82f85e7c9..8bbcf904a 100644
--- a/archaeological_files/tests.py
+++ b/archaeological_files/tests.py
@@ -27,45 +27,10 @@ from django.test.client import Client
from ishtar_common.tests import TestCase
-from ishtar_common.models import PersonType, Town, IshtarSiteProfile
+from ishtar_common.models import Town, IshtarSiteProfile
from archaeological_files import models
from archaeological_operations.models import Parcel, ParcelOwner
-from archaeological_operations.tests import OperationInitTest
-
-
-class FileInit(object):
- def login_as_superuser(self):
- self.client.login(username='username', password='tralala')
-
- def create_file(self):
- self.extra_models, self.model_list = {}, []
- self.user, created = User.objects.get_or_create(username='username',
- is_superuser=True)
- self.user.set_password('tralala')
- self.user.save()
- self.o_user, created = User.objects.get_or_create(username='ousername')
- person_type, created = PersonType.objects.get_or_create(
- label=u'Test ' u'person type', txt_idx='test_person',
- available=True)
- self.extra_models['person_type'] = person_type
- self.model_list.append(person_type)
-
- person = models.Person(surname='Surname', name='Name',
- history_modifier=self.o_user)
- person.save()
- self.extra_models['person'] = person
- self.model_list.append(person)
-
- file_type, created = models.FileType.objects.get_or_create(
- label=u'Test file type', txt_idx='test_file', available=True)
- self.extra_models['file_type'] = file_type
- self.model_list.append(file_type)
-
- dct = {'year': 2010, 'numeric_reference': 1000, 'file_type': file_type,
- 'internal_reference': u'UNIT_testÉ ?', 'in_charge': person,
- 'history_modifier': self.o_user, 'total_surface': 10000}
- self.item = self.model(**dct)
- self.item.save()
+from archaeological_operations.tests import OperationInitTest, FileInit
class FileTest(TestCase, FileInit):