summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_operations/tests.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 9d5b9c616..e1ae68237 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -699,7 +699,8 @@ class OperationTest(TestCase, OperationInitTest):
'../archaeological_operations/fixtures/initial_data-fr.json']
def setUp(self):
- IshtarSiteProfile.objects.create()
+ IshtarSiteProfile.objects.get_or_create(
+ slug='default', active=True)
self.username, self.password, self.user = create_superuser()
self.alt_username, self.alt_password, self.alt_user = create_user()
self.alt_user.user_permissions.add(Permission.objects.get(
@@ -886,7 +887,8 @@ class OperationSearchTest(TestCase, OperationInitTest):
'../archaeological_operations/fixtures/initial_data-fr.json']
def setUp(self):
- IshtarSiteProfile.objects.create()
+ IshtarSiteProfile.objects.get_or_create(
+ slug='default', active=True)
self.username, self.password, self.user = create_superuser()
self.alt_username, self.alt_password, self.alt_user = create_user()
self.alt_user.user_permissions.add(Permission.objects.get(
@@ -1012,7 +1014,7 @@ class RegisterTest(TestCase, OperationInitTest):
def testSearch(self):
c = Client()
response = c.get(reverse('get-administrativeact'), {'year': '2014'})
- # no result when no authentification
+ # no result when no authentication
self.assertTrue(not json.loads(response.content))
c.login(username=self.username, password=self.password)
response = c.get(reverse('get-administrativeact'), {'year': '2014'})
@@ -1037,34 +1039,39 @@ class OperationWizardCreationTest(WizardTest, OperationInitTest, TestCase):
FormData(
"Create a preventive diag",
form_datas={
+ 'filechoice-operation_creation': {},
'general-operation_creation': {
'operation_type': 1, # preventive diag
'year': 2016},
'townsgeneral-operation_creation': [],
'parcelsgeneral-operation_creation': [],
},
- ignored=('filechoice-operation_creation',
- 'towns-operation_creation',
+ ignored=('towns-operation_creation',
'parcels-operation_creation',
'preventive-operation_creation',)
),
FormData(
"Create another preventive diag with same parcel name",
form_datas={
+ 'filechoice-operation_creation': {},
'general-operation_creation': {
'operation_type': 1, # preventive diag
'year': 2016},
'townsgeneral-operation_creation': [],
'parcelsgeneral-operation_creation': [],
},
- ignored=('filechoice-operation_creation',
- 'towns-operation_creation',
+ ignored=('towns-operation_creation',
'parcels-operation_creation',
'preventive-operation_creation',)
)
]
def pre_wizard(self):
+ profile, created = IshtarSiteProfile.objects.get_or_create(
+ slug='default', active=True)
+ profile.files = True
+ profile.save()
+
if 'townsgeneral-operation_creation' not in \
self.form_datas[0].form_datas:
return super(OperationWizardCreationTest, self).pre_wizard()