summaryrefslogtreecommitdiff
path: root/archaeological_operations/tests.py
diff options
context:
space:
mode:
authorValérie-Emma Leroux <emma@iggdrasil.net>2017-04-07 11:40:31 +0200
committerValérie-Emma Leroux <emma@iggdrasil.net>2017-04-07 11:40:31 +0200
commit7f22d3c20cc24debfe123425efa63ec5293e4b4c (patch)
treef773b80964981c231c892ee5255b94285bc5620a /archaeological_operations/tests.py
parent9127307734c85b816ac7dbb539b565ffb106d60f (diff)
parentda4af2ab5d105f6d2ce442b517e532b7570616e3 (diff)
downloadIshtar-7f22d3c20cc24debfe123425efa63ec5293e4b4c.tar.bz2
Ishtar-7f22d3c20cc24debfe123425efa63ec5293e4b4c.zip
Merge branch 'master' of git.iggdrasil.net:/srv/git/ishtar
Conflicts: archaeological_operations/templates/ishtar/sheet_operation.html
Diffstat (limited to 'archaeological_operations/tests.py')
-rw-r--r--archaeological_operations/tests.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py
index 9d5b9c616..67f9454fa 100644
--- a/archaeological_operations/tests.py
+++ b/archaeological_operations/tests.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2012-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2012-2017 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -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()