Fix Candidat residence_permits definition
This commit is contained in:
parent
e3f6c82301
commit
069b7302bf
3 changed files with 67 additions and 1 deletions
18
candidats/migrations/0006_residence_permits_nullable.py
Normal file
18
candidats/migrations/0006_residence_permits_nullable.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.0.1 on 2018-02-01 13:53
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('candidats', '0005_rename_candidat_field'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='candidate',
|
||||
name='residence_permits',
|
||||
field=models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Pas nécessaire'), (1, 'Nécessaire - OK'), (2, 'Manquante')], default=0, null=True, verbose_name='Autor. de séjour (pour les pers. étrang.)'),
|
||||
),
|
||||
]
|
||||
|
|
@ -119,7 +119,7 @@ class Candidate(models.Model):
|
|||
aes_accords = models.PositiveSmallIntegerField("Accord AES", choices=AES_ACCORDS_CHOICES, default=0)
|
||||
residence_permits = models.PositiveSmallIntegerField(
|
||||
"Autor. de séjour (pour les pers. étrang.)",
|
||||
choices=RESIDENCE_PERMITS_CHOICES, blank=True, default=0
|
||||
choices=RESIDENCE_PERMITS_CHOICES, blank=True, null=True, default=0
|
||||
)
|
||||
accepted = models.BooleanField('Admis', default=False)
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,54 @@ class CandidateTests(TestCase):
|
|||
)
|
||||
self.assertEqual(cand.interview, inter)
|
||||
|
||||
def test_add_candidate(self):
|
||||
url = reverse('admin:candidats_candidate_add')
|
||||
post_data = dict({},
|
||||
city = 'Peseux',
|
||||
section = 'EDE',
|
||||
certificate_of_payement = 'on',
|
||||
interview = '',
|
||||
gender = 'F',
|
||||
aes_accords = '0',
|
||||
mobile = '077 999 99 99',
|
||||
registration_form = 'on',
|
||||
birth_date = '15.03.1997',
|
||||
residence_permits = '',
|
||||
corporation = '',
|
||||
_save = 'Enregistrer',
|
||||
marks_certificate = 'on',
|
||||
avs = '75609994444567',
|
||||
activity_rate = '',
|
||||
last_name = 'G.',
|
||||
deposite_date = '31.01.2018',
|
||||
police_record = 'on',
|
||||
examination_result = '',
|
||||
diploma_detail = 'Maturité linguistique',
|
||||
handicap = 'on',
|
||||
work_certificate = 'on',
|
||||
comment = 'Le casier judiciaire a été envoyé par e-mail le 30.01.2018',
|
||||
certif_of_800_general = 'on',
|
||||
instructor = '',
|
||||
validation_sfpo = '',
|
||||
email = 'caterina.g@example.org',
|
||||
file_result = '',
|
||||
cv = 'on',
|
||||
diploma_status = '2',
|
||||
pcode = '2034',
|
||||
first_name = 'Caterina',
|
||||
reflexive_text = 'on',
|
||||
diploma = '4',
|
||||
has_photo = 'on',
|
||||
certif_of_800_childhood = 'on',
|
||||
district = 'Ne',
|
||||
option = 'PS',
|
||||
interview_result = '',
|
||||
street = 'de Neuchâtel 99',
|
||||
)
|
||||
self.client.login(username='me', password='mepassword')
|
||||
response = self.client.post(url, post_data)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
||||
def test_send_confirmation_mail(self):
|
||||
ede = Section.objects.create(name='EDE')
|
||||
ase = Section.objects.create(name='ASE')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue